I woud like to create a filled rounded rectangle at run-time and assign it as content of a PictureBox (already created and hidden) in Windows Forms.
Do you have an idea how can I implement it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This method fills a rounded rectangle on a graphics object (VB code) :
To call this function, handle the paint event of the picturebox and pass the e.Graphics object as the first argument, and the picturebox’s bounds as the second argument if you want the rectangle to fill your picture box completely.
The d parameter changes the corners’ angle, I call it with a value of 30, you can try different values…
Also, here’s some code to draw (instead of fill) a rounded rectangle: