|
-
Mar 3rd, 2008, 05:51 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Define Parent object of a control - Runtime
Hello guys.
My app accepts to drag a button on a frame, but the button is not in the frame. My frame is in a SSTab
Code:
Private Sub Frame1_DragDrop(Source As Control, x As Single, y As Single)
Select Case Source.Name
Case "NovoBotao":
Set botao = Controls.Add("VB.CommandButton", "btnButtonThree")
With botao
.Visible = True
.Width = 1000
.Caption = "Third Button"
.Top = y
.Left = x
.Parent = Me.Frame1 'this doesnt seem to work
End With
End Select
Debug.Print Source.Name
End Sub
how can I do this?
Thank you
-
Mar 3rd, 2008, 05:55 AM
#2
Re: Define Parent object of a control - Runtime
set botao.container = frame1
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Mar 3rd, 2008, 05:57 AM
#3
Thread Starter
Hyperactive Member
Re: Define Parent object of a control - Runtime
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
|