|
-
Jul 7th, 2006, 11:11 PM
#1
Thread Starter
New Member
Using a Label within a class
Hi, what I'm trying to do here is allow the user on the actual form to enter the number of 'Count' (that's what the class is called) to be made. It receives a value for the variable 'Name', then allots it to Labelx.Text. Then, I would like Labelx to appear on the actual form, but it does not. Can anyone tell me why? This code should actually be pretty simple for experience programmers, but unfortunately I am not. Please excuse the redundancy of my code, for I can clear that up later.
Public Class Count
' Option Explicit On - needed?
Dim Name As Integer
Dim Number As Integer
Dim IsBeat As Boolean
Public Sub Set_Number(ByVal Number As Integer)
Number = Number
Name = CStr(Number)
End Sub
Public Function Get_Number()
Dim Labelx As New Label
Labelx.Size = New System.Drawing.Size(50, 50) ' Is this needed?
Labelx.Location = New System.Drawing.Point(100, 100) ' Is this needed?
Labelx.Text = Name
Labelx.Visible = True
End Function
End Class
Best regards,
Ben.
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
|