I am in real troubles: I want to create a Windows form application in VB.NET 2008, and I want to create a circle-shaped window.
How can I do it? Can anyone help me?
I am in real troubles: I want to create a Windows form application in
Share
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.
Some things you have to do to make this work properly. First off, it is important to wait until the OnLoad() method runs. Only then do you know how large the window got. It won’t be the design size on another machine when the user runs the video adapter at a different DPI. You’ll also have to remove the border and caption, they no longer work well when you give the window a shape. Which leaves it up to you to re-implement the work they do. At a minimum you’d want to allow the user to still move the window.
A sample form that does this:
Use this as a starting point to implement your own window chrome. You’ll probably want to add a glyph that lets the user close the window. The BackgroundImage property is a good way to give the window a ‘texture’. Or modify OnPaint() to draw your own.