Gipsy
asked on
user control
Hello, I am putting together a control that gets and sets the labels text. I am putting this functionality within the name property below:
Private dname As String
Property name1() As String
Get
name1 = dname
End Get
Set(ByVal Value As String)
dname = Label1.Text
End Set
End Property
I want to set the label name within control in the implementation program, and not sure how to do it and if my property is looking right at all?
Private dname As String
Property name1() As String
Get
name1 = dname
End Get
Set(ByVal Value As String)
dname = Label1.Text
End Set
End Property
I want to set the label name within control in the implementation program, and not sure how to do it and if my property is looking right at all?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks,
But i cant get it to work in implementation,
I want to put smth like this
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
usercontol.name1() = "Start of the month"
End Sub
But i cant get it to work in implementation,
I want to put smth like this
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
usercontol.name1() = "Start of the month"
End Sub
jmacmicking:
Gipsy is using vb.NET (not mentioned - but you can tell because of the Property statement layout) therefore, Label1.Text is correct, not Label1.Caption.
Gipsy is using vb.NET (not mentioned - but you can tell because of the Property statement layout) therefore, Label1.Text is correct, not Label1.Caption.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub