I would like to create a VB usercontrol that contains an oval shape. I want a dragover event to occur when the source touches the oval shape rather than the rectangular extent of themy usercontrol. It this possible? Many thanks in advance
I can think of two ways to handle this. The first one is very easy but requries the oval to be in one solid colour. The second requires some math calculation to check if the mouse X and Y position is inside the shape.
Let me know if you have the shape filled with a solid color or not.
But if he uses an antialiased picture of the oval in an image control for example that won't work completely. Nonetheless, it wouldn't be much of a problem.
But if he uses an antialiased picture of the oval in an image control for example that won't work completely. Nonetheless, it wouldn't be much of a problem.
No it wouldn't. But he doesn't so it doesn't matter. I just provided a very simple solution without going in to any APIs or advanced mathematical code.
Another solution would be to simply set the BackStyle of the UserControl to Transparant, since the mouse move event will not be fired while the mouse is over a transparent part.
No it wouldn't. But he doesn't so it doesn't matter. I just provided a very simple solution without going in to any APIs or advanced mathematical code.
Another solution would be to simply set the BackStyle of the UserControl to Transparant, since the mouse move event will not be fired while the mouse is over a transparent part.
Apparently, if you set the BackStyle to transparent... none of the components in it are visible (similar as if the usercontrol was invisible). Is there anything else that needed to be set to avoid this??
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
Apparently, if you set the BackStyle to transparent... none of the components in it are visible (similar as if the usercontrol was invisible). Is there anything else that needed to be set to avoid this??
That's not true. Put a Shape control on a usercontrol, set the BackStyle to transparent and see for yourself. The Shape is still visible.
EDIT: See the attached image, as you can see the UserControl is transparent but the Shape control is visible.
Last edited by Joacim Andersson; Apr 22nd, 2005 at 08:18 AM.
Ok, you're right. I opened a new project and was able to do it. I don't know why but I couldn't on the other one. However, if you use an Image (with transparent backgound), the effect is not seen.
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
When a question has been resolved please edit your origional post in the thread and add the word [RESOLVED] to the title. You should also use the green checkmark as the post icon.