Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graphic Objects

Status
Not open for further replies.

snorky

Programmer
Jun 5, 2001
58
GB
I need some info on how to make a graphic object selectable after I've drawn it ( like in a DTP program ) So I can draw a rectangle and then go back to it later and select it and manipulate it etc. Anyone with any info or good links on how to do this kind of stuff ????

Regards,
Snorky
 
Bad news: In VB you can not select a graphic object. There is no event for mouse down, mouse up, etc.
But you can use a workarround: you can place a picture box on your form and inside the picturebox you place a graphic object. You can then select at runtime the picture box and move it arround (using moude down/move/up events of the picturebox control). This is the first idea that croses my mind...

Hope I've been helpful,
Bogdan Muresan.
 
Thanks for the reply - is this true of all the .net stuff too ( C# ?) or is it a case of having to learn C++ to do this?
 
You could create a struct or class which defines the coordinates of your graphic object then in the mousemove event check the x and Y coordinates of the mouse and if it falls within your object's coordinates redraw accordingly.

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Do you mean the structure that is passed to the polygon api?

Private Type POINTAPI
X As Long
Y As Long
End Type



Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Check out my examples in thread222-867954; they may be of some use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top