Hi, I'm fairly new to visual basic and programming in general... i'm teaching myself quickly, but of course we run into little problems.
In a basic project, i have an imagebox with an image already loaded, a vertical scroll bar, and a label. When the user scrolls the scroll bar in the form, it must change the height of the image according to the value of the scroll bar and display the value in the label. So far i have:
_________________________________________________________________________
Public Class Form1
Private vsbSquirt As AccessibleObject
Private Sub vsbSquirt_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs)
lblHeight.Text = vsbSquirt.Value
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblHeight.Text = vsbSquirt.Value
End Sub
Sub ImageHeight(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles imgSquirt.SizeChanged
SetAttr(imgSquirt.Size(157, vsbSquirt.Value))
End Sub
End Class
_________________________________________________________________________
I'm not too sure how to tell the program to resize the image and i've been playing around for hours and hours slowly eliminating errors and reached this conclusion with only 1 error left... under "imgSquirt.Size" in the last Sub and reads: "structure 'system.drawing.size' cannot be indexed because it has no default property"
Any help or tips is greatly appreciated, thanks
In a basic project, i have an imagebox with an image already loaded, a vertical scroll bar, and a label. When the user scrolls the scroll bar in the form, it must change the height of the image according to the value of the scroll bar and display the value in the label. So far i have:
_________________________________________________________________________
Public Class Form1
Private vsbSquirt As AccessibleObject
Private Sub vsbSquirt_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs)
lblHeight.Text = vsbSquirt.Value
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblHeight.Text = vsbSquirt.Value
End Sub
Sub ImageHeight(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles imgSquirt.SizeChanged
SetAttr(imgSquirt.Size(157, vsbSquirt.Value))
End Sub
End Class
_________________________________________________________________________
I'm not too sure how to tell the program to resize the image and i've been playing around for hours and hours slowly eliminating errors and reached this conclusion with only 1 error left... under "imgSquirt.Size" in the last Sub and reads: "structure 'system.drawing.size' cannot be indexed because it has no default property"
Any help or tips is greatly appreciated, thanks