|
-
Assigning a TextBox Control via a Class Property
Hi everyone,
Another cry for help from someone lost in the wilderness...
I have a class that defines a TextBox as a property, along the lines of:
Private WithEvents JunkBox As TextBox
Public Property Get BoxData() As TextBox
Set BoxData = JunkBox
End Property
Form_Load creates an instance of the class, and uses the Set Property to assign an existing TextBox on the form to the newly-created object:
Private Sub Form_Load()
Dim m_Object As clsClass
Set m_Object = New clsClass
With m_Object
Set .BoxData = txtTextBox
End With
End Sub
Stepping through the code, I access the various properties and methods of the class, so I know the form "sees" the class. However, the assignment of the text box control from the form to the object doesn't work. txtTextBox is set to "" when I try to Set .BoxData. How do I get the class/object to recognize the TextBox control?
Thanks in advance for your help!
-- Miles
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks