IPhone-like button with digital winform button C # mimic security guard glass button (source code)

Source: Internet
Author: User


Effect:



Because similarCodeGoogle hasn't found it for a long time, and finally found this article in the garden.


C # simulate the ecurity guard glass button (source code)


Due to my limited level, I am eager to use it, so I am adding a little bit of code to barely achieve similar results. In addition, I would like to thank the source code provided by the original author (A Dongdong ).



 



The other parts are not modified. The Code void drawimage (Graphics g) adds the rounded rectangle and number effects to the code.


If (bitmapnum> 0) {int x = This. width-26; int X1 = This. width-21; int width = 20; Switch (bitmapnum. tostring (). length) {Case 2: x = x + 2; width = width + 4; break; Case 3: x = x-4; X1 = x + 3; width = width + 10; break; Case 4: x = x-8; X1 = x + 1; width = width + 16; break;} fillroundrectangle (G, new rectangle (x, 2, width, 20), bitmapcolor, 6); G. drawstring (bitmapnum. tostring (), new font ("Arial", 9, fontstyle. bold), new solidbrush (color. white), X1, 4 );}


The code is poorly written. Let's take a look at it. We also want to see if you have any better methods to provide me. Thank you.



If the code is not clear, you can compare it with the original author's code.



 



Source code:



/Files/hpze2000/glassbutton.zip



 



 


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.