我遇到了麻烦,无法找到出路
我正在尝试单击一个按钮,然后让用户在文本框 7 和 8 中输入输入,然后重用文本框 7 和 8 来获取接下来的两个值,一旦完成,线条就被绘制了…… </p>
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics As System.Drawing.Graphics
Dim x1 As Integer
Dim y1 As Integer
Dim x2 As Integer
Dim y2 As Integer
x1 = TextBox7.Text
y1 = TextBox8.Text
'clears textbox values...
TextBox7.Text = ""
TextBox8.Text = ""
'set focus to textbox7...
TextBox7.Focus()
x2 = TextBox7.Text
y2 = TextBox8.Text
formGraphics = Me.CreateGraphics()
formGraphics.DrawLine(myPen, x1, y1, x2, y2)
myPen.Dispose()
formGraphics.Dispose()
End Sub
目前,在单击按钮之前需要先填充文本框,我希望它反过来..
有人知道怎么做吗?
使用 VB.net...