Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
5
Erster Beitrag:
vor 4 Monaten, 2 Wochen
Letzter Beitrag:
vor 4 Monaten, 2 Wochen
Beteiligte Autoren:
Yogi Yang, Fabrice Harari, Allard

[WM20] - How to dynamically resize a Static Control?

Startbeitrag von Yogi Yang am 06.07.2017 05:03

Hello,

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

TIA

Antworten:

Hi

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

Best regards

von Fabrice Harari - am 06.07.2017 12:23
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

von Yogi Yang - am 07.07.2017 10:31
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

von Fabrice Harari - am 07.07.2017 14:21
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

von Allard - am 07.07.2017 22:58
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.