Huzaifa
Huzaifa

Reputation: 9

Visual Basic PowerPacks Oval Shape control, displayed as a Circle on the form and I want to increase its size from the center

I have a Visual Basic PowerPacks Oval Shape control, displayed as a Circle on the form and I want to increase its size from the center of the last position, so that I can increase it from all sides i.e. the center, how can I do it, I tried this.

//This code to draw circle on the clicked area.

MouseEventArgs clickArgs = (MouseEventArgs)e; Graphics graphics = this.CreateGraphics();

float circlesize = 100;

int x = Convert.ToInt32(clickArgs.X - circlesize / 2);
int y = Convert.ToInt32(clickArgs.Y - circlesize / 2);

ovalShape1.Location = new Point(x, y);


//To increase its size        

 ovalShape1.Width = ovalShape1.Width + 10;
 ovalShape1.Height = ovalShape1.Height + 10;  

The Current code is increasing the size from the last X,Y Position which is not correct. :(

Upvotes: 0

Views: 426

Answers (0)

Related Questions