Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 2 Wochen, 5 Tagen
Letzter Beitrag:
vor 2 Wochen, 4 Tagen
Beteiligte Autoren:
JP, Fabrice Harari, ccc2

[WD21] - Adding controls and adjusting scrollbars

Startbeitrag von JP am 04.07.2017 14:31

Hi All,

Maybe a strange problem :) I have a window to which I programatically add controls, one underneath the other vertically. There is an unknown number of such controls which I need to add, can be 100+ for example. When I do this the window vertical scroll bar does not size sufficiently to allow me to scroll to the bottom of the controls that I have added. The scrollbar only appears if I size the window to less than the design height.

How do I force the scroll bar to appear so that it reflects the total true height of all the controls I have added to the form?





2 questions the same day with basically the same answer...

The usual way to do this is to add your control into a supercontrol, increase its size, and it will provide the scrollbars when it is bigger than the window itself. And don't change the window size.

Best regards

von Fabrice Harari - am 04.07.2017 14:55
lol! Yes, that is a coincidence indeed!

I have not used supercontrols before. How does one go about doing what you suggest?

von JP - am 04.07.2017 15:04

I have created a blank supercontrol and am adding my controls to it. But the scrollbars do not appear. I think I might be missing some settings for the window and/or the supercontrol. Any suggestions where to look?

von JP - am 04.07.2017 15:21

OK, I found the SuperControl.UsefulHeight property and that is the one I needed to increase beyond the height of the control itself. Doing that and the vertical scrollbar appeared as required.


von JP - am 04.07.2017 16:03
if i remember correctly , in the wd help, advice not to use supercontrol , it is recommend to use control template.

von ccc2 - am 04.07.2017 16:10
AFAIK, Control templates do not provide an automatic scrollbar when the template is bigger than the screen, while supercontrols do. Which is why they are used in that case.

Best regards

von Fabrice Harari - am 05.07.2017 18:26
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.