Click here to Skip to main content
15,920,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Guys! Can you teach me how to make an irregular shape user control in C#?
I have a code that draws a semi circular rectangle and I want my user control to be shape like my semi circular rectangle...
Please help me, a code snippet will do... or anything..
Thanks! :)

PS: my first time to post a question in here.. :)
If you have any problems/reactions on how I questioned in here, please tell me.. thanks again! :)
Posted

Derive your control from the respective base class, e.g.
public class MyButton : System.Windows.Forms.Button
and override the OnPaint method:
protected override void OnPaint(PaintEventArgs e)
See e.g. AquaButton: A sample custom button control with a Mac OS X look[^]
If you use WPF, you can use styles for existing controls.
 
Share this answer
 
Comments
Fealrone Alajas 11-May-12 4:15am    
oooh... ok.. i haven't try it yet but dude, thanks a lot for the help! really appreciate it. :) ill comment here if there are line of code(s) which is/are difficult in my part. again thanks! :)
 
Share this answer
 

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