Jump to content


Photo

beforeinit in runtime

beforeinit runtime

  • Please log in to reply
1 reply to this topic

#1 zanona

zanona

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 68 posts

Posted 30 August 2017 - 04:18 PM

I need to load the beforeinit event in runtime but it does not work! Follow the code below!
 
Procedure TMainmForm.setColorBack (vpComp: TUNIMDBNUMBEREDIT);
   Var
     VrsStr: string;
Begin
   VrsStr: = 'beforeInit = function beforeInit (sender, config)';
   VrsStr: = vrsStr + '{';
   VrsStr: = vrsStr + 'config.maxLength = 10;';
   VrsStr: = vrsStr + 'config.clearIcon = false;';
   VrsStr: = vrsStr + 'config.inputCls =' 'DataeditMobile yellowBG' '';
   VrsStr: = vrsStr + '}';
 
   VpComp.ClientEvents.ExtEvents.Clear;
   VpComp.ClientEvents.ExtEvents.Add (vrsStr);
End;
 
I call the event in the wind form create
   SetColorBack (SP_Esf_L_OD);
 
Thanks
 
Zanona

  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3430 posts

Posted 31 August 2017 - 06:20 AM

Hi,

 

You can not change beforeInit dynamically, only before the initialization of the control, for example:

 

Only in these places:

 

In Designtime (ClientEvents->UniEvents),

OnFormCreate,

When creating a control dynamically

 

Best regards,


  • 0





Also tagged with one or more of these keywords: beforeinit, runtime

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users