Paint on Visual Basic 6 problem.?

john g

New member
So our professor gave us codes to make our programming life easier. My paint program works well, until I move the rectangle in the scroll bar manually (ie. Dragging it using the mouse). When I do that, the following error shows: Invalid procedure call or argument

My peers passed theirs already, thinking that it's OK. However, I want it removed. Here is the code for the two HScroll bars (one for changing color, and one for changing size):

Private Sub HScroll1_Change()
Shape1.BackColor = QBColor(HScroll1.Value)
Shape2.BackColor = QBColor(HScroll1.Value)
Picture1.ForeColor = QBColor(HScroll1.Value)

End Sub

Private Sub HScroll1_Scroll()
Shape1.BackColor = QBColor(HScroll1.Value)
Shape2.BackColor = QBColor(HScroll1.Value)
Picture1.ForeColor = QBColor(HScroll1.Value)

End Sub

Private Sub HScroll2_Change()
Shape2.Width = HScroll2.Value * 10
Shape2.Height = HScroll2.Value * 10
Shape2.Left = (Frame1.Width - Shape2.Width) / 2
Shape2.Top = (Frame1.Height - Shape2.Height) / 2
Picture1.DrawWidth = HScroll2.Value

End Sub

Private Sub HScroll2_Scroll()
Shape2.Width = HScroll2.Value * 10
Shape2.Height = HScroll2.Value * 10
Shape2.Left = (Frame1.Width - Shape2.Width) / 2
Shape2.Top = (Frame1.Height - Shape2.Height) / 2
Picture1.DrawWidth = HScroll2.Value

End Sub

Thanks!
 
Back
Top