|
|
#1 |
|
New Member
Join Date: Apr 05
Posts: 8
![]() |
Oval UserControl
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
Jeffow |
|
|
|
|
|
#2 |
|
Guru
Join Date: Jan 99
Location: Interactive Medica
Posts: 11,086
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Oval UserControl
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.
__________________
Joacim Andersson Microsoft MVP, MCSD, MCSE, Sun Certified Java Programmer If anyones answer has helped you please show your appreciation by rating that answer. I'd rather run ScriptBrix... Joacim's view on stuff. |
|
|
|
|
|
#3 |
|
Old Member
Join Date: Nov 04
Location: In Hiding.... Weather: sizzzzlin'........ Code: Secret
Posts: 2,701
![]() ![]() ![]() ![]() ![]() |
Re: Oval UserControl
see if this helps
http://www.vbforums.com/showthread.p...highlight=oval |
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 05
Posts: 8
![]() |
Re: Oval UserControl
In reply to the question raised by Joacim - yes, the shape will always be solid filled, so I would like to hear your idea.
many Thanks Jeffow |
|
|
|
|
|
#5 | |
|
Guru
Join Date: Jan 99
Location: Interactive Medica
Posts: 11,086
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Oval UserControl
Quote:
VB Code:
__________________
Joacim Andersson Microsoft MVP, MCSD, MCSE, Sun Certified Java Programmer If anyones answer has helped you please show your appreciation by rating that answer. I'd rather run ScriptBrix... Joacim's view on stuff. |
|
|
|
|
|
|
#6 |
|
Addicted Member
Join Date: Jul 04
Location: Amman, Jordan
Posts: 179
![]() |
Re: Oval UserControl
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.
|
|
|
|
|
|
#7 | |
|
Guru
Join Date: Jan 99
Location: Interactive Medica
Posts: 11,086
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Oval UserControl
Quote:
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.
__________________
Joacim Andersson Microsoft MVP, MCSD, MCSE, Sun Certified Java Programmer If anyones answer has helped you please show your appreciation by rating that answer. I'd rather run ScriptBrix... Joacim's view on stuff. |
|
|
|
|
|
|
#8 | |
|
Need-a-life Member
Join Date: Apr 00
Location: Buenos Aires, Argentina
Posts: 6,808
![]() |
Re: Oval UserControl
Quote:
__________________
Emiliano F. Martín 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. |
|
|
|
|
|
|
#9 | |
|
Guru
Join Date: Jan 99
Location: Interactive Medica
Posts: 11,086
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Oval UserControl
Quote:
EDIT: See the attached image, as you can see the UserControl is transparent but the Shape control is visible.
__________________
Joacim Andersson Microsoft MVP, MCSD, MCSE, Sun Certified Java Programmer If anyones answer has helped you please show your appreciation by rating that answer. I'd rather run ScriptBrix... Joacim's view on stuff. Last edited by Joacim Andersson; Apr 22nd, 2005 at 08:18 AM. |
|
|
|
|
|
|
#10 |
|
Need-a-life Member
Join Date: Apr 00
Location: Buenos Aires, Argentina
Posts: 6,808
![]() |
Re: Oval UserControl
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 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. |
|
|
|
|
|
#11 |
|
New Member
Join Date: Apr 05
Posts: 8
![]() |
Re: Oval UserControl [closed]
Many Thanks for all the input. I think I now consider this resolved.
jeffow |
|
|
|
|
|
#12 |
|
Guru
Join Date: Jan 99
Location: Interactive Medica
Posts: 11,086
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Oval UserControl
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
__________________
Joacim Andersson Microsoft MVP, MCSD, MCSE, Sun Certified Java Programmer If anyones answer has helped you please show your appreciation by rating that answer. I'd rather run ScriptBrix... Joacim's view on stuff. |
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|