Page 1 of 1

Chương trình vẽ 13 dòng code

Posted: Sun 14/12/2008 10:48 am
by clarkkent
Thủ thuật: Chương trình vẽ 13 dòng code
Tác giả: Nguyễn Trung Tín
Mô tả: Chương trình vẽ 13 dòng code


:) >:P @-)

Code: Select all

  1.    Dim bNhan As Boolean
  2.     Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
  3.         bNhan = True
  4.     End Sub
  5.     Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
  6.         bNhan = False
  7.     End Sub
  8.     Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
  9.         If bNhan Then
  10.             Dim graphic As Graphics = CreateGraphics()
  11.             graphic.FillRectangle(New SolidBrush(Color.Red), e.X, e.Y, 4, 4)
  12.         End If
  13.     End Sub