Using a Button, one can program changes in size by using btnChange.width = 500. I would like to use a similar line to change the location of a button. The location property has an X and Y value but I cannot seem to program it to change the button position. I tried something like btnChange.Location.Y = 200 but the system tells me that "the expression is a value and therefore cannot be the target of a assignment. Does it make sense that the size can be the target but location cannot?
I have used lines like: btnMoveMe.Location = (200, 200) and btnMoveMe.Location.Y = 200 but the system tells me that the expression is a value and cannot be the target of an expression.
Loading
Kirtan PatelPosted Nov 20, 2009, 9:05 PM
Here is Clean Code how you can do it :)
mark "Do you like this answer check box " please :)
private void button1_Click(object sender, EventArgs e)
{
int CurrentX = button1.Location.X;
int CurrentY = button1.Location.Y;
button1.Location = new Point(CurrentX + 10, CurrentY + 10);
}
EmerogorkPosted Nov 21, 2009, 12:29 AM
It has been a long tine that I wrote in C but the syntax converted to BASIC easily...
EmerogorkPosted Nov 21, 2009, 12:27 AM
But I don't see how to work with:
Where/how to click???