VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Simple VB Program for beginners. Draws cirlce on form on mousemove event.

by G.J.Sastry (1 Submission)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 25th December 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Simple VB Program for beginners. Draws cirlce on form on mousemove event.

API Declarations


'Simple Mouse Event Program--------For beginners
'Take a new form,2 command buttons and write the following code



Rate Simple VB Program for beginners. Draws cirlce on form on mousemove event.



' On mousemove over commandbutton form gets cleared 


Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  Form1.Cls
End Sub

'******************************************************************************
' On mousemove over commandbutton 2 form gets exit

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

' On mousemove over form circle is drawn.  Left click draws bigger cirlce whereas rightclick draws smaller


Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim i As Integer
  Randomize
  i = Int(15 * Rnd)
  FillStyle = 0
  FillColor = QBColor(i)
  Circle (X, Y), 200
End Sub



Download this snippet    Add to My Saved Code

Simple VB Program for beginners. Draws cirlce on form on mousemove event. Comments

No comments have been posted about Simple VB Program for beginners. Draws cirlce on form on mousemove event.. Why not be the first to post a comment about Simple VB Program for beginners. Draws cirlce on form on mousemove event..

Post your comment

Subject:
Message:
0/1000 characters