c# - Move a control from a method in Windows Form -
high level question, possible move control method? example, have label , button click event, can label move 1 position (x,y) button click (x+20,y+20)?
i haven't had luck changing .position property of label, , couldn't find online thought ask. thanks!
edit: asked show code here ya go. label1.position can't selected/edited, , label1.move event handler, when user moves label?
private void movetextbutton_click(object sender, eventargs e) { label1.position = (x,y); //label1.move }
just change location :
private void movetextbutton_click(object sender, eventargs e) { label1.location = new point(label1.location.x + 20, label1.location.y + 20); }
Comments
Post a Comment