473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Changing the shape of user control surface

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.
Mar 19 '08 #1
1 1620
On 19 Mar, 11:22, Lorenzo <lorenzo.fornare...@framenet.itwrote:
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.
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

Mar 19 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jawahar Rajan | last post by:
All, I have a printer friendly page that is opened when a user clicks a link on my page to get the printer friendly version, How ever when they close out the printer friendly version and return to...
2
by: gary | last post by:
I am building a simple window form application with c#. Now I get 2 questions: 1. I need a control like shape control which could let me lay shape(circle, line etc..) in form. does c# have one?...
0
by: Shailaja Kulkarni | last post by:
Hi All, I am new to component development. I want to create custom control to arrange contained controls in form of polygonal shape. The objects are placed in separate panel on the some form....
10
by: BBM | last post by:
Hi, I have been developing with C# User Controls and occasionally have a problem where I "lose" a control from the design surface of the User Control. The controls that I am using to build my...
1
by: AJ | last post by:
Hi guys, any clues or suggesstion on how to programatically change the shape of a button from rectangular to say elliptical or circular. Meaning that when the mouse hovers just within the shape,...
5
by: Marcel Gelijk | last post by:
Hi, I am trying to create a User Control that is located in a seperate class library. The User Control contains a textbox and a button. The page generates an exception when it tries to access...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
2
by: Jim Frazer | last post by:
Hi, I'm working on an application in C# that will allow the user to create simple CAD drawings on a CEPC system. I would like to be able to change the cursor shape depending on the drawing mode...
1
by: perse981 | last post by:
Hi I need to know how, if even possible, to enable the user of my program to control the Size and Posisiton of the circle I have Drawn on the form by using the Enter Key (to increase size), Shift...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.