PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WD23] - Scrollabe Image on a Window
[WD23] - Scrollabe Image on a Window
Débuté par JP, 21 aoû. 2018 10:59 - 3 réponses
Posté le 21 août 2018 - 10:59
Hi All

I want to put an image control on a window. The image can be larger than the window so I want the window to have scrollbars so that the user can scroll the image up/down and left/right to see it all.

So I add the image control to a test window. The image is larger than the window. I switch on Automatic Scrollbars for the window. But when I run the test the window shows no scrollbars and the only way to see more of the image is to resize the window.

What am I missing?
Posté le 22 août 2018 - 04:18
Enquiring minds would like to know... ;)
Posté le 22 août 2018 - 09:22
Art,

You need to set the window width/height in design mode to some "large" value (whatever you like to be the maximum width/height the window should/can handle). Switch auto-scrollbars on. Then when the window is created you change the width/height to something smaller in the initialization code of the window or the instance creation code of the window. This change makes WD switch on the scrollbars for the window because WD has been told the window must handle a larger area.

Then the image control on the window you set to just 100%, top left corner, no resize or anchoring. If the image control is larger than the visible window area then you can use the window scrollbars to view it. If it is smaller than the visible window area then you obviously will see it all without scrolling.
Posté le 22 août 2018 - 15:17
Thanks JP!