|
-
Nov 6th, 2000, 04:54 AM
#1
Thread Starter
New Member
My user input form is about 3 times the height of a Regular Maximized VB form.So I need to Have a Scroll bar which scrolls all my controls as soon as the control gets the focus or as I click the Up/Down arrow buttons of the Scroll bar. The functionality should work with Shift+Tab keys also. I need to implement this is my project. Please help. Please consider this as a urgent case and do send me answers asap.
Thanks,,
Shiva Prasad
Programmer,
Lumley Technology India,
Hitec City,
Hyderabad.
-
Nov 6th, 2000, 06:31 AM
#2
Add PictureBox and insert the listboxes (or whatever you use) in it. Then add vertical scrollbar.
Code:
Private Sub Form_Resize ()
Picture1.Move 0, 0, ScaleWidth - Scroll1.Width, ScaleHeight
For A = 0 To List1.Count - 1
List1.Move 0, ScaleHeight * A, Picture1.ScaleWidth, ScaleHeight
Next A
Scroll1.Max = List1.Count - 1
End Sub
Private Sub List1_GetFocus (Index As Integer)
Scroll1.Value = Index
End Sub
Private Sub Scroll1_Change ()
Picture1.Top = -Scroll1.Value * ScaleHeight
End Sub
SORRY! I understood wrong! And now I need to make other reply so I can see what you wrote. Hate when this happens 
[Edited by MerryVIP on 11-06-2000 at 06:34 AM]
-
Nov 6th, 2000, 06:39 AM
#3
Correction
Okay, the same without listboxes.
Code:
Private Sub Form_Load ()
Scroll1.Max = (Picture1.Height - ScaleHeight) / 15
End Sub
Private Sub Form_Resize ()
'You have to set picture1 height yourself
Picture1.Move 0, 0, ScaleWidth - Scroll1.Width
Scroll1.Move ScaleWidth - Scroll1.Width, 0, , ScaleHeight
End Sub
Private Sub Scroll1_Change ()
Picture1.Top = -Scroll1.Value * 15
End Sub
Private Sub Example_GetFocus ()
If Scroll1.Max <= Example.Top Then Scroll1.Value = Example.Top
End Sub
Hope I now got it right,
[Edited by MerryVIP on 11-06-2000 at 06:42 AM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|