Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Components
|
VB Components Issues specific to components in VB.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 23rd, 2005, 05:12 AM
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default access containedcontrols in a control

I need top be able to access the controls that are present in an ActiveX ctrl....
I've tried
for Each CTRL in usercontrol.containedcontrols
   if CTRL.name = "LB1" then CTRL.Caption = "Name"

next
 ...does'nt work

I've tried
   X = instr(1,"LB",usercontrol.containedcontrols.item(i)
   if X <> 0 then CTRL.Caption = "Name"
...does not work ....

Basically I need to refresh the controls with new data; BTW.. the controls have been dynamically created in the resize event of the Control, and on each button click that causes a movenext, they have to be refreshed with the new values....
Please Help


Michael
 
Old August 23rd, 2005, 12:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dim ctl as Control
for each ctl in Controls
if ctl.name = ...
next

The ContainedControls is the collection of controls that have been added by the container of the ActiveX (a Form for example) if the ControlContainer property of the ActiveX is set to true (it is false by dafault). In you case, it seems that the controls are added inside the ActiveX, thus you can use the Controls collection.

Marco
 
Old August 24th, 2005, 03:06 PM
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Marco...Works fine ..though I used another method to get around this problem...






Similar Threads
Thread Thread Starter Forum Replies Last Post
Access control from usercontrol peter2004 ASP.NET 1.x and 2.0 Application Design 10 January 28th, 2010 11:00 PM
401.3 Access denied due to Access Control List cforsyth .NET Framework 2.0 8 May 28th, 2009 01:56 PM
How to Access Control on a From from different cla [email protected] C# 2005 2 October 27th, 2007 05:51 AM
TemplateField control access cmw231 ASP.NET 2.0 Basics 0 July 11th, 2006 08:50 AM
Access the dynamic control using C# kapi.goel C# 19 February 2nd, 2006 07:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.