artem_niko Posted April 14, 2020 Share Posted April 14, 2020 Hello! I need execute somebody event when frame change own size. For example. I have a UniForm and frame. This is frame creating in this UniForm. And when UniForm change own size, frame also change own size and at this moment I want run my event, for example, ShowMessage('ololo'); Event must be executing only when frame change own size, not UniForm. Is it possible make? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 14, 2020 Share Posted April 14, 2020 2 hours ago, Артем said: Event must be executing only when frame change own size, not UniForm. Hello, Can you please explain? 2 hours ago, Артем said: I have a UniForm and frame. This is frame creating in this UniForm. And when UniForm change own size, frame also change own size Make a simple testcase if possible... Quote Link to comment Share on other sites More sharing options...
artem_niko Posted April 14, 2020 Author Share Posted April 14, 2020 1 minute ago, Sherzod said: Hello, Can you please explain? Make a simple testcase if possible... Do you know about event of form as know as Maximize? If not use UniGUI and use standart Win32 project on VCL. I need analog of this event. When form maximize - frame also change own size and on this moment I must show message. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 14, 2020 Share Posted April 14, 2020 2 minutes ago, Артем said: Do you know about event of form as know as Maximize? Yes, I know. 4 minutes ago, Артем said: I need analog of this event. When form maximize... Maybe you want this event? YourForm.ClientEvents.ExtEvents -> function window.maximize(sender, eOpts) { } 1 Quote Link to comment Share on other sites More sharing options...
mhmda Posted April 14, 2020 Share Posted April 14, 2020 Cehck this: https://docs.sencha.com/extjs/6.7.0/classic/Ext.window.Window.html#event-maximize Quote Link to comment Share on other sites More sharing options...
artem_niko Posted April 14, 2020 Author Share Posted April 14, 2020 10 minutes ago, Sherzod said: Yes, I know. Maybe you want this event? YourForm.ClientEvents.ExtEvents -> function window.maximize(sender, eOpts) { } Hm...Maybe... And what about Frame? Is it event YourFrame.ClientEvents.ExtEvents -> function resize(sender, width, height, oldWidth, oldHeight, eOpts) { } Is analog of event form? YourForm.ClientEvents.ExtEvents -> function window.maximize(sender, eOpts) { } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 14, 2020 Share Posted April 14, 2020 Well, as you know, these two events are different in the sense that resize event is always executed when resizing ... And the frame does not have the "maximize" event. Quote Link to comment Share on other sites More sharing options...
mhmda Posted April 14, 2020 Share Posted April 14, 2020 What exactly you want to do? For resizing the Frame the best solution is layout. 1 Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted April 14, 2020 Share Posted April 14, 2020 i use this WorkAround: Please set a uniImage in the background of your frame (without Picture - just the uniImage) set all Anchors .. and test following code: procedure TyourFrameName.UniImage1Resize(Sender: TUniControl; OldWidth, OldHeight: Integer); begin a_test_uniLabel.Caption:=inttostr(UniImage1.Width) +' - '+ inttostr(UniImage1.Height) end; if you resize your frame OR the Webbrowser - you will get the event ... and if your image is Aligne: alClient - you will get the Width and Height of your frame Hope this helps :-) Erich 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.