|
-
Feb 19th, 2003, 12:23 AM
#1
Thread Starter
Hyperactive Member
Getting .Top & .Left properties of self
Ok, In my code of my activex control, I want to be able to get the .Left & .Top properties of itself on the form.
Like say in the UserControl_Initialize() method.....
Code:
Private Sub UserControl_Initialize()
Dim nTop as Integer, nLeft as Integer
nTop = Me.Top
nLeft = Me.Left
End Sub
.... except Top & Left properties dont exist.... So how do I get the top and left props? :/
-
Feb 19th, 2003, 12:52 AM
#2
Thread Starter
Hyperactive Member
Ok, solved....
Code:
Dim wndpl As WINDOWPLACEMENT
GetWindowPlacement UserControl.hwnd, wndpl
-
Feb 19th, 2003, 11:20 AM
#3
The Left and Top (and many other) properties of a UserControl are available through the Extender property. The Extender object handles the properties of a control that are managed by it's container.
The Extender properties are not available until the control has been sited (ie cannot be used in the Initialize event).
Private Sub UserControl_Show()
Dim nTop as Integer, nLeft as Integer
nTop = UserControl.Extender.Top
nLeft = UserControl.Extender.Left
End Sub
-
Feb 19th, 2003, 08:54 PM
#4
Thread Starter
Hyperactive Member
ahh... Thanks a bunch!
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
|