Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi There,

I created a round windows form by adding the following code into the Piant event:

C++
System.Drawing.Drawing2D.GraphicsPath objGP = new System.Drawing.Drawing2D.GraphicsPath();
         objGP.AddEllipse(new Rectangle(0, 0, this.Width , this.Height));
         this.Region = new Region(objGP);
         this.FormBorderStyle = FormBorderStyle.None;


How can I do to enable this form to be resized like like a normal windows form with borders?

e.g. When the mouse is on the edge/corner of the form one of the size cursors should display and i should be able to resize the form in that way.

Any suggestions?
Posted

Your problem is that you need to deal with everything. You need to decide where the user clicks to resize, capture the mouse when they click there, until they raise the button, then resize your form in code as they move it. It's not terribly difficult, but it's not a one step process. I think the hard part will be working out the logic for where you click and drag to resize.
 
Share this answer
 
Thanks for your response.

Yeah at the moment i can only resize it when clicking on the top,bottom, left and right edges of the circle by using the top,left,width and height propertie in conjuction with the screen size.

I have no idea how to resize the form when the user clicks anywhere else.
I also want it to be able to resize both the width and heigt at the same time like when you resize a normal form from the corners.

Don't know where to start
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900