Click here to Skip to main content
15,849,328 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
How to change shape of command button in vb.net
Posted
Comments
Sergey Alexandrovich Kryukov 7-Jun-11 1:29am    
Tag the library! WPF, Forms, ASP.NET, what? Don't force experts to do double work.
--SA

To set up a non-rectangular shape of control, you need to set its property System.Windows.Forms.Control.Region to some non-rectangular region (of the type System.Drawing.Region).

This is the only way to do it with Forms. The ways not using Region may only visually create a non-rectangular impression, but operating with mouse can easily proof this is cheating. In real non-rectangular, mouse events are dispatched to the control only withing the region.

That was about System.Windows.Forms. In WPF, this is much easier to do. Are you interested? (Too bad you did not tag the UI library you want to use. Do it!)

—SA
 
Share this answer
 
Comments
Amit Kumar Tiwari 7-Jun-11 7:16am    
Correct, my 5 :)
Sergey Alexandrovich Kryukov 7-Jun-11 16:32pm    
Thank you, Amit.
--SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 7-Jun-11 1:28am    
First link is cheating -- this is not a correct way, easy to see incorrect behavior. The second reference contains a correct answer. Well, I'll vote 4.
Please see my answer where I explain it.
--SA
Amit Kumar Tiwari 7-Jun-11 7:17am    
Thanks SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900