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