473,378 Members | 1,383 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Control Limit

When looping through controls on a form, there seems to be a limit of 57,
even though there are 75 on the form. This is the code:
Dim sControl As Control

For Each sControl In Me.Controls

next sControl

I looked at the Forms designer Generated Code and me.Controls.AddRange only
contains 57 out of the 75 controls.

Any ideas.

Thanks,
Richard


Nov 20 '05 #1
3 1951
"Richard Grene" <rg****@s4si.com> scripsit:
When looping through controls on a form, there seems to be a limit of 57,
even though there are 75 on the form. This is the code:
Dim sControl As Control

For Each sControl In Me.Controls

next sControl

I looked at the Forms designer Generated Code and me.Controls.AddRange only
contains 57 out of the 75 controls.


This code will only enumerate the controls which are placed directly
onto the form, not the controls nested inside containers.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Hi, You're seeing this because you have controls as part of other controls,
e.g. checkboxes within a group box, or buttons in a panel (or of course
anything else where there are child controls in a parent control). If this
is the case, you need to perform a recursive search, which searches for
child controls within controls.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

"Chaos, Panic, Disorder, my work here is done"
"Richard Grene" <rg****@s4si.com> wrote in message
news:ah********************@speakeasy.net...
: When looping through controls on a form, there seems to be a limit of 57,
: even though there are 75 on the form. This is the code:
: Dim sControl As Control
:
: For Each sControl In Me.Controls
:
: next sControl
:
: I looked at the Forms designer Generated Code and me.Controls.AddRange
only
: contains 57 out of the 75 controls.
:
: Any ideas.
:
: Thanks,
: Richard
:
:
:
:
Nov 20 '05 #3
Hi Richard,

If any of the Controls are contained within another Control, eg a Panel,
they will be in the Controls collection of the Panel rather than of the Form.

Regards,
Fergus
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Grant Harmeyer | last post by:
I have an application that uses FreeTextBox 2.0 (http://www.freetextbox.com). FreeTextBox is a rich text editor that behaves similarly to MS Word. The FreeTextBox control has a button to insert...
1
by: Israel | last post by:
The problem: I want to know, definitively when a slider loses focus after a user has started sliding and hasn't released the mouse yet. It appears that this is captured with the WM_ACTIVATEAPP...
5
by: (PeteCresswell) | last post by:
Two list boxes on a form. As I change the vertical size, I compute available height as ..WindowHeight - lstFirst.top - horizontalPadding - bottomMargin It all works fine until I size the form...
0
by: JohnyStyles | last post by:
I have a templated user control which looks like this: ----------------------------------------------------------------- <uc:MyUserControl runat=server> <TemplateProperty> </TemplateProperty>...
24
by: tizi_de | last post by:
Hello all, I'm looking for a sample program in C to print out lines not to the standard MS Dos Box but into a different control e.g. text control. Has C the possibility to do printouts to a...
0
by: =?Utf-8?B?am1obWFpbmU=?= | last post by:
I'm trying to create a process that allows me to limit the non-alphanumeric characters generated with the PasswordRecovery control. Specially I want to suppress some characters for security...
1
by: irvine4ever84 | last post by:
I have a notepad,which having a data store into it and then overwrite by a new data every 1 second constantly. I want to read the data (which is the total bandwidth usage of my whole WLAN)which...
1
by: KMEscherich | last post by:
Microsoft Access '97 Hi there, I have developed an Access database and am attempting to limit the rows in a control that has been set up as a DATASHEET view. This control has been placed on a...
2
by: Zuhaib Hyder | last post by:
i've to populate my treeview control on page load, just like msdn website.. i've 4 levels Department --> Wing --> Section --> Files --> Pages i've almost 20 million pages... so, is this fine...
7
by: robert.waters | last post by:
I have an Access database frontend linked via ODBC to a large (gigabytes) mysql database. I need to view a large amount of data in a a textbox (variable up to 300K), but I receive a 'there isnt...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.