求VB画图板程序

来源:百度知道 编辑:UC知道 时间:2024/05/09 08:17:32
求VB画图板程序,要求,能画出直线,圆,点,矩形,有铅笔功能和橡皮功能,谢谢~~高手来帮帮忙呀

不能画矩形,其他功能都能实现.以前自己做的.需要的话可以发给你.
Dim t As Byte, s As Byte, c As Byte

Private Sub Command1_Click()
t = 1
If Form1.ForeColor = Form1.BackColor Then ForeColor = QBColor(c)
If Form1.DrawWidth = 12 Then Form1.DrawWidth = s
End Sub

Private Sub Command2_Click()
Form1.DrawWidth = 12
t = 2
End Sub

Private Sub Command3_Click()
Cls
Form1.ForeColor = vbBlack
Form1.DrawWidth = 1
t = 1
End Sub

Private Sub Form_Load()
Dim i%
For i = 0 To 15
Picture1(i).BackColor = QBColor(i)
Next i
Form1.ForeColor = vbBlack
t = 1
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
CurrentX = X: CurrentY = Y
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = 1 And t = 1 Then Line -(X, Y)
If Button = 1 And t = 2 Then Form1