Update label location in C#?

前端 未结 6 402
春和景丽
春和景丽 2020-12-15 23:24

I have a method that returns a value, and I want this value to be the new location of a label in a windows form application. but I\'m being told that a label\'s location is

6条回答
  •  天涯浪人
    2020-12-15 23:44

    objectA.Location = new Point((int)A.position, objectA.Location.Y);
    objectA.Refresh();
    

    Location is no a variable, just a public Property. Changing variables through properties is a bady idea unless you have events that update the parent.

提交回复
热议问题