mrhicks
August 6th, 2001, 04:55 PM
Hello all,
I am trying to create a UserControl (UC) and within the UC I wanted to draw my own border around it. The problem is trying to create the lines. If you use
UserControl.Line (X1, Y1)-(X2,Y2), Color, BF
or
' This is contain within the UserControl
PictureBox.Line (X1, Y1)-(X2,Y2), Color, BF
Both raise a compile error of ( Expect: = ). So I change the syntax around to the following
' This is contain within the UserControl
PictureBox.Line X1,Y1, X2, Y2, Color, BF
Ok, this doesn't give me a compile error, but it sure doesn't work correctly. So out of desperation I put a PictureBox and two Lables ( Text1 and Text2 ) within a form an added the following code to see if I can figure it out what in the world is going on.
private m_X as Single
private m_Y as Single
private Sub Picture1_Click()
With Picture1
.DrawWidth = 1
.DrawStyle = vbSolid
.FillColor = vbRed
.ForeColor = vbRed
.CurrentX = 10
.CurrentY = 10
.Line 1, 1, m_X, m_Y, vbRed, 0
End With
End Sub
private Sub Picture1_MouseMove(Button as Integer, Shift as Integer, X as Single, Y as Single)
Text1.Text = X
m_X = X
Text2.Text = Y
m_Y = Y
End Sub
But this doesn't work. It seems that when I move the mouse vertically then click within the Picture box the ending x coordinate of the line moves, but no matter where I move the mouse on the horizontal plane does it affect the ending x coordinate. Please, what am I missing????? I am so confused. In addition, I don't want to fill create any boxes or fill anything, but if I leave off the BF it tells me the arugment is not optional. What is the deal here? This is also try for the Color aspect of the parameters being passed into the Line method. If you search the on-line by pressing F1 it list the standard
object.Line [step] (x1, y1) [step] - (x2, y2), [color], [b][F]
Which doesn't seem to apply for the the Line method for either the PictureBox or a UserControl.
Mark
I am trying to create a UserControl (UC) and within the UC I wanted to draw my own border around it. The problem is trying to create the lines. If you use
UserControl.Line (X1, Y1)-(X2,Y2), Color, BF
or
' This is contain within the UserControl
PictureBox.Line (X1, Y1)-(X2,Y2), Color, BF
Both raise a compile error of ( Expect: = ). So I change the syntax around to the following
' This is contain within the UserControl
PictureBox.Line X1,Y1, X2, Y2, Color, BF
Ok, this doesn't give me a compile error, but it sure doesn't work correctly. So out of desperation I put a PictureBox and two Lables ( Text1 and Text2 ) within a form an added the following code to see if I can figure it out what in the world is going on.
private m_X as Single
private m_Y as Single
private Sub Picture1_Click()
With Picture1
.DrawWidth = 1
.DrawStyle = vbSolid
.FillColor = vbRed
.ForeColor = vbRed
.CurrentX = 10
.CurrentY = 10
.Line 1, 1, m_X, m_Y, vbRed, 0
End With
End Sub
private Sub Picture1_MouseMove(Button as Integer, Shift as Integer, X as Single, Y as Single)
Text1.Text = X
m_X = X
Text2.Text = Y
m_Y = Y
End Sub
But this doesn't work. It seems that when I move the mouse vertically then click within the Picture box the ending x coordinate of the line moves, but no matter where I move the mouse on the horizontal plane does it affect the ending x coordinate. Please, what am I missing????? I am so confused. In addition, I don't want to fill create any boxes or fill anything, but if I leave off the BF it tells me the arugment is not optional. What is the deal here? This is also try for the Color aspect of the parameters being passed into the Line method. If you search the on-line by pressing F1 it list the standard
object.Line [step] (x1, y1) [step] - (x2, y2), [color], [b][F]
Which doesn't seem to apply for the the Line method for either the PictureBox or a UserControl.
Mark