.net - How to create a rounded rectangle at runtime in Windows Forms with VB.NET/C#? -


I create a rounded round rectangle over the wound and make it a picturebox (already created and hidden) windows In the form.

Do you have any idea how can I apply it? This method fills a rounded rectangle on a graphic object (VB code):

Pre> public subfill references (byVal g as illustration, in the form of graphics, as in the form of rectangles, as byval as integer, byVal b as brush) dim mode like Drawing2D .SmoothingMode = g.SmoothingMode g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed ​​g.FillPie (B, Rx, RI, D, D, 180, 90) g. Philippi (B, Rx + R., Withth-D, RI, D, D, 270, 90) Philippi (B, Rx, RI + R.Hight-D, D, D, 90, 90) Philippi (B, Rx + R.Width - d, ry + r.Height - d, d, d, 0, 90) g.FillRectangle (b, cInt (rx + d / 2), ry, r.Width - d , CInt (d / 2)). Filtratengel (B, Rx, CINT (RI + D / 2), R. Withth, CINT (R.Hight-D)). Filtratengel (B, CINT (Rx + D / 2), CINT (RI + R.Hy-D / 2), CINT (R-Width-D) CINT (D / 2) G. SMTuringMode = Mode and All

To call this function, handle the painted event of PictureBox and pass the E. graphics object as the first argument, and limitations as the second debate in the picture box Rectangular chains to fill the box completely

D parameter changes the angle of the corners, I call it with the value of 30, you can try different values.

In addition to this, there is some code (instead of filling) to draw a rounded rectangle:

  Public sub-drawnctengel (by the way Valji drawings). Graphics, By-Rail Rectangle In form (P, Rx, RI, D, D, 180, 90) G. drown (P, CINT (Rx + D / 2), RI, CIA Nati (Rx + R.with-D / 2), RI) G. DRAC (P, RX + R. with-D, RI, D, D, 270, 90) G. Drollin (P, Rx, CINT + D / 2), Rx, CINT (RI + R. Hi-d / 2)) g. Drawline (P, CINT (Rx + R. vethhtha), CINT (RI + D / 2), CINT (Rx + R with with), CINT (RI + R.Hight-D / 2) G. Drollin (P, CINT (Rx + D / 2), CINT (RI + R.High), CINT (Rx + R. with-D / 2), CINT (RI + R. High) G. DRAC (P, Rx, RI + R. Hight-D, D, D, 90, 90) G. Drac (P, Rx + R. with-D, RI + R.Hight-D, D, D, 0, 90) and all  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -