|
-
Nov 8th, 2006, 08:26 PM
#6
Re: [2005] Expression is a value and therefore cannot be the target of an...
 Originally Posted by Copernicus
Yes, but...
VB Code:
If e.KeyChar = "w" Then
Label1.Top = Label1.Location.Y - 3
End If
If e.KeyChar = "a" Then
Label1.Left = Label1.Location.X - 3
End If
Those work, but right and bottom don't...they say they are readonly.
Hmmm... I read this post again.
A control's Location is determined by the coordinates of its upper, left corner, which correspond to its Top and its Left. Bottom and Right are ReadOnly because they are calculated. Bottom is equal to Top plus Height, while Right is equal to Left plus Width. If you change the Top or Height property then the Bottom property will change accordingly, but you cannot set it directly. It exists for convenience, so that you don't have to calculate it yourself if you need to position other controls relative to the bottom of this one.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|