 |

04-22-2006, 02:58 PM
|
 |
Freshman
|
|
Join Date: Mar 2006
Location: Weston, Fl
Posts: 48
|
|
Create something from nothing?
|
I know that this is probably a very basic thing to do, but I can't figure out how to word it to search the forums and internet:
I'm just goofing off with VB and want to make it so that when I move my mouse, a new circle object is left where my mouse was just at (same principle as when you paint)
I have the circle following my mouse already, but I can't figure out for the life of me how to make another shape get left where my mouse was. I created a second object with an index of 0, since I'm sure I will have to use this to make all of the new objects.
Again, I'm just goofing off with VB and this is probably going to bug me all night if I don't figure it out lol
Thanx in advance!
~Derek
|
|

04-22-2006, 05:04 PM
|
|
Centurion
|
|
Join Date: Sep 2005
Location: Wisconsin
Posts: 131
|
|
|
Instead of using shapes, try using VB's .Circle function.
|
|

04-22-2006, 06:06 PM
|
 |
Contributor
|
|
Join Date: May 2005
Location: Australia
Posts: 549
|
|
|
also try drawing onto the form without clearing...
|
|

04-23-2006, 02:56 AM
|
 |
Centurion
|
|
Join Date: Mar 2005
Location: Croatia
Posts: 143
|
|
put this code in a new project:
Code:
Const r = 10 'radius
Private Sub Form_Load()
Me.ScaleMode = vbPixels
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Me.Circle (X - r / 2, Y - r / 2), r
End If
End Sub
|
|

04-23-2006, 07:08 AM
|
 |
Freshman
|
|
Join Date: Mar 2006
Location: Weston, Fl
Posts: 48
|
|
Quote:
|
Originally Posted by zBlade1
put this code in a new project:
Code:
Const r = 10 'radius
Private Sub Form_Load()
Me.ScaleMode = vbPixels
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Me.Circle (X - r / 2, Y - r / 2), r
End If
End Sub
|
iiiinnnnnsssssaaaannnnneeeee
lol Thanx! =)
~Derek
|
|

04-23-2006, 07:48 AM
|
|
Regular
|
|
Join Date: Mar 2006
Location: San Salvador, El Salvador
Posts: 54
|
|
|
As a suggestion, put the "AutoRedraw" forms property to "True", so losing the focus don't lead to image erasing
|
__________________
sorry my english
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|