Is it possible to make your main form scrollable ? I want to insert a scrollbar on my form, but I can't figure out how to scroll.. I thought that a scrollbar would appear if you maximized your form and the form is too big for the window.. Doesn'T seem to act this way. I've been searching on this forum for this and it seems that it is not possible to do ?
I'm suspicious about this. Anyone can help me out ?
On one of my screens, I have made it scrollable where the user reduces the size of the form below what it should be. This is how I did it.
I put a picture box on the form, and put all the controls within the picture box. I then put scroll bars outside the picture box ie to the right and below.
If the user reduces the screen below my threshold, then I enable the scroll bars eg:
Private Sub vsbScrollBar_Change()
Dim nPos As Integer
nPos = Me.Height - vsbScrollBar
nPos = Me.Height - nPos
picScreen.Top = nPos * -1
End Sub
Private Sub hsbScrollBar_Change()
Dim nPos As Integer
nPos = Me.Width - hsbScrollBar
nPos = Me.Width - nPos
picScreen.Left = nPos * -1
End Sub
I've used ur sample codes its wonderful, only can u expand it to, when I click the arrows (up or down) the display scroll very slowy how i can change the speed of scrolling.
I found a article in ELementKJournals that shows that the Form has its own scrollbars. It is relatively simple and you can scroll the form without the use of Pictureboxes. The only restriction is that controls without hwnds will disappear when scrolled off the viewport. To circumvent this put them, or everything in a picturebox,
Check out the attached .ZIP file
Option Explicit
Dim WithEvents vbLink As EventVB.APIFunctions
Dim WithEvents vbWnd As EventVB.ApiWindow
Private Sub Form_Load()
Set vbLink = New APIFunctions
Set vbWnd = New ApiWindow
With vbWnd
.hWnd = Me.hWnd
.ScrollBars = vbBoth
.AutoScroll = True
End With
vbLink.SubclassedWindows.Add vbWnd
End Sub
Set the form's ClipControls member to false for best effect.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.