|
| ||||||||||
| Tags: button, c sharp, dot net, visual studio |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Self made Button In C#
I am working with visual studio, dot net framework. I need to make a custome Button using C# code. I need a button control that will allow me to display multiple icons/bitmaps simultaneously. Please help. |
|
#2
| |||
| |||
| Re: Self made Button In C#
Have a look at this page. http://msdn.microsoft.com/library/de...bpowerpack.asp Its for VB & you will need to convert it for C#. Hope this helps! |
|
#3
| ||||
| ||||
| Re: Self made Button In C#
An alternative is to create a new bitmap of appropriate size and draw an icon in each corner of the bitmap. Then assign this new bitmap to the buttons image property. OR Have a look at this page. http://dotnetrix.co.uk/buttons.html |
|
#4
| ||||
| ||||
| Re: Self made Button In C#
Try this code out. Code: Rectangle BitmapRect = Rectangle.FromLTRB(0, 0, button1.Width, button1.Height); BitmapRect.Inflate(-6, -6); Bitmap srcImage = new Bitmap(@"c:\test.bmp"); srcImage.MakeTransparent(); Bitmap bmp = new Bitmap(BitmapRect.Width, BitmapRect.Height); Graphics g = Graphics.FromImage(bmp); //TopLeft corner g.DrawImage(srcImage, Point.Empty); //Topright corner g.DrawImage(srcImage, BitmapRect.Width - srcImage.Width, 0, srcImage.Width, srcImage.Height); //BottomLeft corner g.DrawImage(srcImage, 0, BitmapRect.Height - srcImage.Height, srcImage.Width, srcImage.Height); //BottomRight corner g.DrawImage(srcImage, BitmapRect.Width - srcImage.Width, BitmapRect.Height - srcImage.Height, srcImage.Width, srcImage.Height); button1.Image = new Bitmap(bmp); g.Dispose(); bmp.Dispose(); |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Self made Button In C#" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to use the G button in LG optimus black to lock screen or as camera button | Zh@veri | Portable Devices | 7 | 05-12-2011 08:25 PM |
| Trackpad button and the left mouse button of my MacBook is not working | Eun | Portable Devices | 12 | 26-09-2011 11:01 PM |
| InPrivate Browsing the go button and File button Open are not working | Afiq | Technology & Internet | 3 | 06-04-2011 08:24 AM |
| Mute button and PowerCinema Button don't work | Appaji | Hardware Peripherals | 4 | 09-04-2010 05:37 AM |
| Convert Sleep Button in Shutdown button In Vista | Kraker999 | Customize Desktop | 3 | 19-03-2009 11:45 PM |