PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WM20] - How to dynamically resize a Static Control?
[WM20] - How to dynamically resize a Static Control?
Iniciado por guest, 06,jul. 2017 07:03 - 4 respuestas
Publicado el 06,julio 2017 - 07:03
Hello,

How to dynamically resize a Static control if its contents do not fit into it based on its design time size?

TIA
Publicado el 06,julio 2017 - 14:23
Hi

you check if text fits with textwidth and textheight
you change the statis size with ..width and ..height

Best regards
Publicado el 07,julio 2017 - 12:31
Hello Fabric,

Thanks for the tip. Now I will be able to enlarge width or height as necessary.

But now I am facing another problem!

The controls adjutant to the control enlarged at times are getting overlapped. How to handle this. I mean if a controls height is increased then all the controls below the control in question should also move downwards. Is there any way to automate this or have we to calculate the new positions for each control programmatically?

Another thing I observed that it is impossible to understand as to which controls fall below (on on the right) the control in question.

I am using EnumControls for processing all controls.

TIA
Publicado el 07,julio 2017 - 16:21
Hi

if you change the size programmatically, then you need to move the other controls programmatically too.

Now, if you resize only ONE control, you can put all the controls below into a supercontrol and move this one by changing it's ..Y property.

If you need to do that on several controls, then in order to know which controls to move, just compare the ..X and ..Y (or ..X+..Width, etc)

Best regards
Publicado el 08,julio 2017 - 00:58
Hi,

is it a requirement? You could also do a tooltip and cut the name after some size

Just a suggestion. Maybe Take alook at anchoring a control based on an other control

regards