|
-
Apr 3rd, 2018, 11:35 AM
#1
Thread Starter
Lively Member
How can I add a control to a parent form, in design time, through a custom component?
I have create a custom component which changes some properties of it's parent form when placed in design time. But I also want this component, in design time again, to add some controls to it's parent form. I tried something like this code example below, but with no luck. The added control placed on the form, but I can't select it, just stands there!!! Any idea what exactly am I doing wrong? Thank you in advance!!!
Code:
Public Class MyCustomComponent
Private _MyControl As New MyUserControl
'...Rest of my code
Private Sub OnPlace()
'...Rest of my code
_ParentForm.Controls.Add(_MyControl)
End Sub
Private Sub OnDispose()
'...Rest of my code
_MyControl.Dispose()
End Sub
End Class
Tags for this Thread
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
|