PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD21] - Adding controls and adjusting scrollbars
[WD21] - Adding controls and adjusting scrollbars
Iniciado por guest, 04,jul. 2017 16:31 - 6 respuestas
Publicado el 04,julio 2017 - 16: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?

Thanks
Publicado el 04,julio 2017 - 16:55
Hi JP

funny

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
Publicado el 04,julio 2017 - 17:04
lol! Yes, that is a coincidence indeed!

I have not used supercontrols before. How does one go about doing what you suggest?
Publicado el 04,julio 2017 - 17:21
Fabrice

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?
Publicado el 04,julio 2017 - 18:03
Fabrice,

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.

Thanks
Publicado el 04,julio 2017 - 18:10
if i remember correctly , in the wd help, advice not to use supercontrol , it is recommend to use control template.
Publicado el 05,julio 2017 - 20:26
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