Innovative1
Member
- Joined
- Feb 24, 2013
- Messages
- 8
- Programming Experience
- Beginner
I want to create my own control having combination of multiple controls......and also use it multiple time at run-time with different behavior.
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim myShape1 As New ShapeControl
Dim myShape2 As New ShapeControl
With myShape1
.Name = "Shape No. 1"
.Top = 100
.Left = 100
End With
With myShape2
.Name = "Shape No. 2"
.Top = 100
.Left = 400
End With
AddHandler myShape1.Click, AddressOf ShapeClicked
AddHandler myShape2.Click, AddressOf ShapeClicked
Me.Controls.Add(myShape1)
Me.Controls.Add(myShape2)
End Sub
Private Sub ShapeClicked(sender As System.Object, e As System.EventArgs)
Dim myShape = DirectCast(sender, ShapeControl)
MsgBox(myShape.Name)
End Sub
Hi,
You would code the Click event of the Control.
Cheers,
Ian
I take it you missed my last post?
Cheers,
Ian
Hi,
That's a bit vague since you give no indication what DLL you are talking about. On the basis that you have been creating a User Control, is this the DLL you are referring to? If so, then check to make sure the DLL exists in the bin\debug Directory of your Project.
Hope that helps.
Cheers,
Ian