473,765 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

round or oval shaped buttons using C#

1 New Member
hii...
plz help me out ,how to create rounded or oval buttons using c# in VS 2005.
Dec 9 '08 #1
3 18197
nukefusion
221 Recognized Expert New Member
Probably the easiest way is to set the region of the button. Subclass Button and adjust the Region with code similar to this:

Expand|Select|Wrap|Line Numbers
  1.  public class ShapedButton : Button
  2.     {
  3.         protected override void OnResize(EventArgs e)
  4.         {
  5.             base.OnResize(e);
  6.             GraphicsPath gp = new GraphicsPath();
  7.             gp.AddEllipse(new Rectangle(Point.Empty, this.Size));
  8.             this.Region = new Region(gp);
  9.         }
  10.     }
Dec 9 '08 #2
Plater
7,872 Recognized Expert Expert
That same concept can be applied to custom shaped forms.
Dec 9 '08 #3
murathankocan
2 New Member
here is a solution I saw recently...
http://www.youtube.com/watch?v=K_JzL4kzCoE
Feb 1 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
4004
by: Poker Man | last post by:
Hi, I know how to do Sumbit buttons in Forms, and I know how to do custom buttons in Javascript. What I can't seem to find is how to do custom Submit buttons using Javascript! Anybody out there have any pagesthat might provide a clue?
0
2103
by: satish | last post by:
.Hi, Can anybody help me!!!!!! how to automate selection of radio buttons using vb.net. I am using mshtml.htmldocument Public Sub OpenDownloadDataPage(ByRef wbBrowser As SHDocVw.InternetExplorer) Dim HTMLDoc1 As mshtml.HTMLDocument Dim iHtmlCol As IHTMLElementCollection Dim iHtmlEle As IHTMLElement
0
1613
by: nevada17 | last post by:
My goal is to find a way to apply scroll bars across the y axis of about 25 check buttons so that my interface isn't too large. I've read about scroll bars and I realize that's its not possible to add scroll bars to a frame, window, or check buttons while using the Perl TK. I was wondering whether anyone has hand any luck with a work around. I've also read about adding a canvas window to a canvas and having widgets inside then applying a...
0
1546
by: vabsjava | last post by:
Hello Everybody..... I want to use command button which is oval in shape..... how to convert the button shaped in rectangle to oval.... please me in this regard... Thank You
1
14592
by: ShambhuHubli | last post by:
Hi ! I am developing front end for some application using Python Tkinter. And I am new to this GUI development. In my application, I have to create buttons other than square or rectangle. I want buttons something like Oval(or any other shape). I searched a lot.. But could'nt get. If any of you know please help me out. Thanks in advance.
2
1598
by: RichmondJim | last post by:
I'm a newbie when it comes to CSS and I tried to incorporate menu buttons using CSS on to our site. It works great (IMHO) in IE6, but someone emailed me that it's really crappy in FF2, so I installed Firefox and... they're right! I tried a couple of possible corrections, but it either made the Firefox worse, or messed up the IE6. Unfortunately, this is a production site so I can't mess around with it too much. Would someone look at...
3
26329
by: kalyanibal | last post by:
can anybody help me out with my problem. in my submit form i have three radio buttons with the title "Mr,Mrs,Miss". how to select one radio button from the above three by using c# code behind. also i have another two radio buttons titled "residential and commercial", how to choose one radio button from the above two using C# code with regards kalyani
2
4672
by: KiranJyothi | last post by:
Hi All, I want to draw some rectangles and then add some buttons. Actually, in my project I have to give user control. This project is about transmitting and receiving packets. When the user presses "Transmit" button, packets should move from transmitter side to receiver side. I am able to draw the rectangles (packets). But, not able to add the buttons. PLEASE let me know if I can add buttons using Graphics2D. Thanks in advance. ...
5
6704
by: satyabhaskar | last post by:
hi all, In my web page i have created radio buttons dynamically on to the page .....following is my code string Course, Semester, Section; int rowsCount; string con = ConfigurationManager.ConnectionStrings.ConnectionString; protected void Page_Load(object sender, EventArgs e) { try
0
9399
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.