Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Need help with user control


Reply
 
Thread Tools Display Modes
  #1  
Old 04-13-2004, 07:03 PM
Needbass2004 Needbass2004 is offline
Regular
 
Join Date: Apr 2004
Location: Ashe County, NC
Posts: 53
Default Need help with user control


Ok I made a user control with an LED DISPLAY and with a textbox input under it, and the Led will show whatever time is in the textbox. The led works perfect. I coded the display.



Anyway when I put the the user control into another project how can I change textbox with the main project? I don't know how the access the textbox from the project. I am going to hide textbox when I get the bugs out of this.

I thought usercontrol1.textbox1.text = "" would work but it won't. If you understand what my problem is, please help me.

Thanks.
Reply With Quote
  #2  
Old 04-13-2004, 07:08 PM
LaVolpe's Avatar
LaVolpe LaVolpe is offline
Ultimate Contributor

* Expert *
 
Join Date: Apr 2004
Location: Illinois
Posts: 2,499
Default

There are a couple of ways. But if this is just for debugging/testing, suggest using the KISS principle: form1.text1.text or Parent.Controls("Text1").Text
__________________
Insomnia is a simple byproduct of "it can't be done" {Window Shaper}
Reply With Quote
  #3  
Old 04-13-2004, 07:22 PM
Needbass2004 Needbass2004 is offline
Regular
 
Join Date: Apr 2004
Location: Ashe County, NC
Posts: 53
Default

The name of my control is LEDDISPLAY, and all I want to know if it is possible to change a value of the user control, in the main project.exe itself.


I am making a timer program and it will show multiple led screens.
I plan on using control arrays.

Maybe I need to give my control a property that holds the time I want displayed, since properties can be changed at runtime.
Reply With Quote
  #4  
Old 04-13-2004, 07:26 PM
LaVolpe's Avatar
LaVolpe LaVolpe is offline
Ultimate Contributor

* Expert *
 
Join Date: Apr 2004
Location: Illinois
Posts: 2,499
Default

Oh, that's different. Add a PUBLIC PROPERTY to your usercontrol, maybe something like Public Property Let DisplayValue(vValue As Long). Then change your LED within that property.
__________________
Insomnia is a simple byproduct of "it can't be done" {Window Shaper}
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
USER CONTROL relocate or move vbbartlett General 4 08-25-2003 08:25 AM
User control problem TomGuy General 3 05-08-2003 08:10 AM
Exposing variables of user control module to all modules in the project nitz General 2 09-10-2002 05:16 AM
DB Connection in user control Ales Zigon Database and Reporting 2 08-10-2002 07:19 AM
User Control Object Access skript_kiddie General 8 07-10-2002 01:52 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->