50分vb编程谁帮我!做毕业设计用 !就是用vb编一个程序!能画圆,直线,和矩形 50
我要毕业了!做毕业设计用!就是用vb编一个程序!能画圆,直线,和矩形!!哪位好心人帮帮我啊!!谢谢了!!不然必不了业啊!!555555555!!!...
我要毕业了!做毕业设计用 !就是用vb编一个程序!能画圆,直线,和矩形!!哪位好心人帮帮我啊!!谢谢了!!不然必不了业啊!!555555555!!!
展开
2个回答
展开全部
建立两个窗体,也可一个,看你自己习惯和要求,我是建了两个。第一个窗体上有三个按钮,它们caption属性分别是“画直线”、“画矩形”“画圆”,其他属性采用默认值。第二个窗体上什么都没有。
第一个窗体的代码:
Public a As Integer
Private Sub Command1_Click()
Form2.Show
a = 1
End Sub
Private Sub Command2_Click()
Form2.Show
a = 2
End Sub
Private Sub Command3_Click()
Form2.Show
a = 3
End Sub
第二个窗体的代码:
Dim oldx As Long
Dim oldy As Long
Private Sub Form_Load()
Me.ForeColor = vbGreen
Me.DrawWidth = 5
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
oldx = X
oldy = Y
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If butten = 1 Then
ElseIf Form1.a = 1 Then
Line (oldx, oldy)-(X, Y)
ElseIf Form1.a = 2 Then
Line (oldx, oldy)-(X, Y), , B
ElseIf Form1.a = 3 Then
Circle (X, Y), 1000
End If
End Sub
很简单的。^o^
不知道符合不符合你的题目。觉得这么简单的,不能作为毕业设计的吧?分给我哦!
第一个窗体的代码:
Public a As Integer
Private Sub Command1_Click()
Form2.Show
a = 1
End Sub
Private Sub Command2_Click()
Form2.Show
a = 2
End Sub
Private Sub Command3_Click()
Form2.Show
a = 3
End Sub
第二个窗体的代码:
Dim oldx As Long
Dim oldy As Long
Private Sub Form_Load()
Me.ForeColor = vbGreen
Me.DrawWidth = 5
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
oldx = X
oldy = Y
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If butten = 1 Then
ElseIf Form1.a = 1 Then
Line (oldx, oldy)-(X, Y)
ElseIf Form1.a = 2 Then
Line (oldx, oldy)-(X, Y), , B
ElseIf Form1.a = 3 Then
Circle (X, Y), 1000
End If
End Sub
很简单的。^o^
不知道符合不符合你的题目。觉得这么简单的,不能作为毕业设计的吧?分给我哦!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询