Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Resizing component issue at run-time
#5
Put the memo and the button inside a IWRegion. Then, in your Memo and Button, set StyleRenderOptions.RenderAbsolute to FALSE.

Now your button will move along with the Memo, whenever it is resized. However, you need to adjust the position of the button, at design time, in a way that it is not exactly how it is supposed to look at runtime, or set it at run time.(IWForm's OnCreate event is a good place to do that). That's because the VCL designer is not able to do all the same tricks that CSS does.

Explanation for the position issue: When you set IWButton1.top := 500 using the object inspector, IW will generate HTML/CSS instructing the browser to place IWButton 500 pixels away from its parent top-left edge. When you make it "relative" (setting RenderAbsolute to False), the browser will displace it 500 pixels from where it should be originally, so it will place the IWButton 500 pixels away from Memo Bottom-Left edge (because both have relative positions and the browser will use the Memo control to calculate the original position of the button control). That's kind of tricky...

If you don't understand the short explanation above, don't worry... It is actually quite confusing indeed and hard to mentally visualize the effect without any help from the browser. So I recommend you to give it a try and find the best settings after some experimentation.

Please let me know if it worked
Reply


Messages In This Thread
Resizing component issue at run-time - by bob9999 - 02-02-2019, 09:12 PM
RE: Resizing component issue at run-time - by Alexandre Machado - 02-18-2019, 10:43 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)