B4J Question Scrollpane HScroll and VScroll Pixel Dimensions

canalrun

Well-Known Member
Licensed User
Longtime User
Hello,
I have a scroll pane in which I'm going to display an image.

I have the horizontal scrollbar and vertical scrollbar set to Always display.

The pixel size of the Scrollpane is 800x600.

The usable pixel area of the innernode is little less than 800x600 because of the width and height taken for the horizontal and vertical scrollbars.

How do I find the usable area of the innernode when it is sized to be just big enough to fit within the scroll pane minus the pixels used by the horizontal and vertical scrollbars.

That is – how do I find the pixel width and height of the horizontal and vertical scrollbars. I'm going to guess that the width and height are dynamic and probably change depending on the resolution of the computer screen running the application.

Barry.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Note that the actual values shouldn't really matter.

See the attached example. It loads a layout with a Pane to the ScrollPane. You can find the exact size in the Pane_Resize event. The nice thing about using the visual designer and specifically anchors is that the layout adopts automatically.
 

Attachments

  • 1.zip
    2.4 KB · Views: 319
Upvote 0
Top