Link to home
Start Free TrialLog in
Avatar of gokhanoz
gokhanoz

asked on

Change Location on Runtime

Hi. I want to change the location of the label (move on the statusbarstrip to left or right) which is on the statusbarstrip during resizing of the mdiform. Thanks
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

1) Are you talking about a Label on the StatusBarStrip itself?

2) Setting a control's location to a point:
Me.Label1.Location = New Point(50, 50)

3) You could set the anchor, like Bottom, Right to keep the label stuck to the bottom-right side of the screen

Bob
Avatar of gokhanoz
gokhanoz

ASKER

OK but anchor is not present in the property list. And the location is not seems to be a member of it.
So you are talking about a Label control on the StatusBarStrip.  How do you want to change the location of the label?

Bob
Statusbarstrip is on the MDIparent form, and  label control is on that statusbarstrip. I want to use anchor property to stuck the control to the rigth side of the screen. But it seems that anchor is not presenet on the property list.  So I prefer to move that control to that right or the left depending the new shape of the mdiparent. Thats what I want to do. Thanks.
While the Anchor is not a browsable property, you can set it in code (at run-time):

Me.Label1.Anchor = AnchorStyles.Bottom Or AnchorStyles.Right

Bob
Bob, I am sorry but its not working. I am testing like that, I added a button, in the click event I wrote that code, and tested on run-time. label is keeping its original position..
How many other controls are on the StatusStrip control?

Bob
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial