Roberto Nicchi Posted May 7, 2021 Share Posted May 7, 2021 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; Quote Link to comment Share on other sites More sharing options...
picyka Posted March 4, 2022 Share Posted March 4, 2022 Hello, how do you treat focus today? Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted March 6, 2022 Author Share Posted March 6, 2022 On 3/4/2022 at 8:05 PM, picyka said: Hello, how do you treat focus today? Hello, sincerly i'm not sure how i solved the problem but i see that now is working... Probably i did something, but now i can't remember ... Do you have a similar problem ? Roberto 1 Quote Link to comment Share on other sites More sharing options...
picyka Posted March 6, 2022 Share Posted March 6, 2022 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.