如何在VB里画一个随意多边形 类似windows的画图 20
如何在VB里画一个随意多边形类似windows的画图最好还能填充颜色十万火急!!!谢谢了太感谢了高手能不能把你的邮箱地址发到weishouhua@163.com我想继续请...
如何在VB里画一个随意多边形 类似windows的画图 最好还能填充颜色
十万火急!!!
谢谢了 太感谢了
高手 能不能把你的邮箱地址 发到weishouhua@163.com
我想继续请教你问题
叩谢了 展开
十万火急!!!
谢谢了 太感谢了
高手 能不能把你的邮箱地址 发到weishouhua@163.com
我想继续请教你问题
叩谢了 展开
1个回答
展开全部
shuixian_edu_cn@163.com
'窗体共添加了以下控件
'6 个按钮:
'cmdColorB
'cmdColorR
'cmdNew
'cmdSetSizeA
'cmdSetSizeB
'cmdSetSizeC
'1 个PictureBox
'pctNo1
Option Explicit
'用于改变颜色的变量
Dim red As Integer
Dim blue As Integer
'画笔粗细变量
Dim a As Integer
'单击此按钮,画笔变蓝
Private Sub cmdColorB_Click()
red = 0
blue = 255
End Sub
'单击此按钮,画笔变红
Private Sub cmdColorR_Click()
blue = 0
red = 255
End Sub
'单击此按钮,画笔回复默认值,黑色
Private Sub cmdNew_Click()
red = 0
blue = 0
a = 1
End Sub
'单击此按钮,画笔变细
Private Sub cmdSetSizeA_Click()
a = 1
End Sub
'单击此按钮,画笔变中细
Private Sub cmdSetSizeB_Click()
a = 5
End Sub
'单击此按钮,画笔变粗
Private Sub cmdSetSizeC_Click()
a = 10
End Sub
Private Sub Form_Load()
a = 1
MsgBox "欢迎进入" & App.ThreadID & "!", vbInformation
End Sub
'PictureBox控件的鼠标按下事件
Private Sub pctNo1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
pctNo1.ForeColor = RGB(red, 0, blue)
pctNo1.DrawWidth = a
pctNo1.Line (X, Y)-(X, Y)
ElseIf Button = 2 Then
pctNo1.DrawWidth = a + 2
pctNo1.Line (X, Y)-(X, Y), RGB(255, 255, 255), B
End If
End Sub
'PictureBox控件的鼠标移动事件
Private Sub pctNo1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
pctNo1.ForeColor = RGB(red, 0, blue)
pctNo1.DrawWidth = a
pctNo1.Line -(X, Y)
ElseIf Button = 2 Then
pctNo1.DrawWidth = a + 2
pctNo1.Line -(X, Y), RGB(255, 255, 255), B
End If
End Sub
'窗体共添加了以下控件
'6 个按钮:
'cmdColorB
'cmdColorR
'cmdNew
'cmdSetSizeA
'cmdSetSizeB
'cmdSetSizeC
'1 个PictureBox
'pctNo1
Option Explicit
'用于改变颜色的变量
Dim red As Integer
Dim blue As Integer
'画笔粗细变量
Dim a As Integer
'单击此按钮,画笔变蓝
Private Sub cmdColorB_Click()
red = 0
blue = 255
End Sub
'单击此按钮,画笔变红
Private Sub cmdColorR_Click()
blue = 0
red = 255
End Sub
'单击此按钮,画笔回复默认值,黑色
Private Sub cmdNew_Click()
red = 0
blue = 0
a = 1
End Sub
'单击此按钮,画笔变细
Private Sub cmdSetSizeA_Click()
a = 1
End Sub
'单击此按钮,画笔变中细
Private Sub cmdSetSizeB_Click()
a = 5
End Sub
'单击此按钮,画笔变粗
Private Sub cmdSetSizeC_Click()
a = 10
End Sub
Private Sub Form_Load()
a = 1
MsgBox "欢迎进入" & App.ThreadID & "!", vbInformation
End Sub
'PictureBox控件的鼠标按下事件
Private Sub pctNo1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
pctNo1.ForeColor = RGB(red, 0, blue)
pctNo1.DrawWidth = a
pctNo1.Line (X, Y)-(X, Y)
ElseIf Button = 2 Then
pctNo1.DrawWidth = a + 2
pctNo1.Line (X, Y)-(X, Y), RGB(255, 255, 255), B
End If
End Sub
'PictureBox控件的鼠标移动事件
Private Sub pctNo1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
pctNo1.ForeColor = RGB(red, 0, blue)
pctNo1.DrawWidth = a
pctNo1.Line -(X, Y)
ElseIf Button = 2 Then
pctNo1.DrawWidth = a + 2
pctNo1.Line -(X, Y), RGB(255, 255, 255), B
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询