Paint Sederhana


Dim paintnow As Boolean


Private Sub CommandAbout_Click()
    Form2.Show
    Form1.Enabled = False
End Sub


Private Sub CommandBrush_Click()
    CommandPensil.Enabled = True
    CommandBrush.Enabled = False
    CommandHapus.Enabled = True
End Sub


Private Sub CommandClear_Click()
    Picture1.Cls
End Sub


Private Sub CommandHapus_Click()
    CommandPensil.Enabled = True
    CommandBrush.Enabled = True
    CommandHapus.Enabled = False
End Sub


Private Sub CommandPensil_Click()
    CommandPensil.Enabled = False
    CommandBrush.Enabled = True
    CommandHapus.Enabled = True
End Sub


Private Sub Form_Load()
    Dim i As Integer
    For i = 0 To 14
    LabelWarna(i).BackColor = QBColor(i)
    Next i
 
    Picture1.ForeColor = QBColor(0)
    Picture1.BackColor = QBColor(15)
End Sub


Private Sub LabelWarna_Click(Index As Integer)
    Picture1.ForeColor = LabelWarna(Index).BackColor
End Sub


Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbLeftButton Then
        paintnow = True
        Picture1.CurrentX = X
        Picture1.CurrentY = Y
    End If
End Sub


Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If paintnow Then
    If CommandPensil.Enabled = False Then
        Picture1.Line -(X, Y), Picture1.ForeColor
        Picture1.DrawWidth = TextPensil.Text
    End If
    If CommandBrush.Enabled = False Then
        Picture1.PSet (X, Y), Picture1.ForeColor
        Picture1.DrawWidth = TextBrush.Text
    End If
    If CommandHapus.Enabled = False Then
        Picture1.Line -(X, Y), vbWhite
        Picture1.DrawWidth = TextHapus.Text
    End If
End If

End Sub


Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbLeftButton Then
        paintnow = False
    End If
End Sub

Penulis : Vuu_Cungkriink ~ Sebuah blog yang menyediakan berbagai macam informasi

Artikel Paint Sederhana ini dipublish oleh Vuu_Cungkriink pada hari Sabtu, 14 Juli 2012. Semoga artikel ini dapat bermanfaat.Terimakasih atas kunjungan Anda silahkan tinggalkan komentar.sudah ada 0 komentar: di postingan Paint Sederhana
 

0 komentar:

Posting Komentar