Jump to content

Setting focused control in a Tuniframe


Roberto Nicchi

Recommended Posts

My unigui application creates Tuniframe inside Tunitabsheet

At the end of the process the INIT method is executed.

The INIT method defined into the frame should move the focus to the desired component (setfocus). Anyway it doesn't work. this focus is somewhere (don't know where) and not in the correct component. I'm doing something wrong ?

thanks  

 

var
  ts:TUniTabSheet;
  idx: Integer;
  frame:Tstandard_frame;
begin
  ts:=TUniTabSheet.Create(self);
  ts.Closable:=true;
  ts.PageControl:=pc;


  ts.Caption:='The frame';
  frame:=Taframe.Create(ts);
 

  frame.Parent:=ts;
  frame.Align:=alClient;
  frame.Show;


  pc.ActivePageIndex:=ts.PageIndex;

  frame.Init; // THIS METHOD SHOULD MOVE THE FOCUS EXECUTING THE SETFOCUS METHOD OF THE DESIRED CONTROL (SEE BELOW)
end;

.......

procedure Taframe.init;override;

.....

procedure Taframe.init;
begin
  acontrol.SetFocus; //  I'm sure this method is executed because i have placed here a showmessage
end;

Link to comment
Share on other sites

  • 9 months later...
3 hours ago, Roberto Nicchi said:

Olá,

sinceramente não sei como resolvi o problema mas vejo que agora está funcionando... Provavelmente fiz alguma coisa, mas agora não me lembro...

Você tem um problema semelhante?

Roberto

I had a problem when it was a date field, but I solved it too

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...