Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / March 2008

Tip: Looking for answers? Try searching our database.

Changing the shape of user control surface

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lorenzo - 19 Mar 2008 11:22 GMT
Hi,
I tried to create a user control with non rectangle shape, but i have
to specify
his size that it implies that i have to specify its width and its
height.
Result that when i click in the box of the control then click event
comes raised.
This is not good when the click is out the shape of the control but in
the box(its surface) that contain it.

Can i specify  a different surface or i have to check the click
position?
Any suggestion is appreciated.
Thanks in advance.
Lorenzo - 19 Mar 2008 12:39 GMT
> Hi,
> I tried to create a user control with non rectangle shape, but i have
[quoted text clipped - 10 lines]
> Any suggestion is appreciated.
> Thanks in advance.

I solved.

I inserted
this snippet in OnPaint method of the user control

Dim gPath As GraphicsPath = New GraphicsPath()
gPath.AddPolygon(pts)
Me.Region = New Region(gPath)

where pts is an Point's array of the Polygon.
If there are other ways to solve it,
I'm opened to learn.
Bye

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.