|
-
Mar 17th, 2000, 06:38 AM
#1
Thread Starter
New Member
How can I scroll inside a picturebox? I loaded a file which has like 20 lines of information. In order to see all of it, you have to be able to scroll. Any ideas?
-
Mar 17th, 2000, 06:43 AM
#2
transcendental analytic
That can be done with the textbox control
-
Mar 18th, 2000, 06:15 PM
#3
Member
Picture box scrolling
Im not sure if it will work with text, but there is way to us scrollbars to view a picture if it is larger than the picture box, here is an example:
Firstly, before you start, draw a picture box inside another, call the back picture box picturebox2 or whatever you want, call the front picture box, picturebox1 or what erver you want, load the text or picture into picturebox1.
Private Sub Form_Load()
Picture2.ScaleMode = vbPixels
Picture1.AutoSize = True
Picture1.BorderStyle = vbBSNone
Picture1.Move 0, 0
VScroll.Move Picture2.Left + Picture2.Width, Picture2.Top, VScroll.Width, Picture2.Height
HScroll.Move Picture2.Left, Picture2.Top + Picture2.Height, Picture2.Width, HScroll.Height
End Sub
Private Sub HScroll_Change()
Picture1.Left = -HScroll
End Sub
Private Sub HScroll_Scroll()
HScroll_Change
End Sub
Private Sub mnuexit_Click()
End
End Sub
Private Sub mnunew_Click()
cmdopen_Click
End Sub
Private Sub mnusave_Click()
cmdsaveas_Click
End Sub
Private Sub Picture1_Resize()
If Picture2.ScaleHeight > Picture1.Height Then
VScroll.Visible = False
Else
VScroll.Max = Picture1.Height - Picture2.ScaleHeight
VScroll.LargeChange = VScroll.Max / 7
VScroll.Value = 0
VScroll.Visible = True
End If
If Picture2.ScaleWidth > Picture1.Width Then
HScroll.Visible = False
Else
HScroll.Max = Picture1.Width - Picture2.ScaleWidth
HScroll.LargeChange = HScroll.Max / 20
HScroll.Value = 0
HScroll.Visible = True
End If
End Sub
Private Sub VScroll_Change()
Picture1.Top = -VScroll
End Sub
Private Sub VScroll_Scroll()
VScroll_Change
End Sub
E-mail me if this works!!
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
|