Update label location in C#?

前端 未结 6 413
春和景丽
春和景丽 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:30

    You can only set properties of structs if you have a direct reference to that struct:

    Point loc = objectA.Location;
    loc.X = (int)A.position;
    objectA.Location = loc;
    

提交回复
热议问题