473,508 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting list of controls from a form

I'm trying to get the list of all of the controls on a form which works great
except for getting the name of the HelpProvider. For instance:
for (int i = 0; i < this.Controls.Count; i++)
{
temp = this.Controls[i].Name;
}
will give me all of the textboxes, treeviews, etc on a form, but will not
give me the name of the helpprovier. Any suggestions of how to do this?

Thanks!

Nov 16 '05 #1
2 12957
Hi Susan,

HelpProvider is not a windows control.
It is a component, that is placed in the "Component Tray".

I'm not sure that.
But AFAIK it can be impossible to get list of
components that does not add into its container
(which inherith IContainer interface).

Look into "InitializeComponent()" method to assure that
the HelpProvider is not added to any container.

Regards

Marcin
I'm trying to get the list of all of the controls on a form which works great
except for getting the name of the HelpProvider. For instance:
for (int i = 0; i < this.Controls.Count; i++)
{
temp = this.Controls[i].Name;
}
will give me all of the textboxes, treeviews, etc on a form, but will not
give me the name of the helpprovier. Any suggestions of how to do this?

Thanks!

Nov 16 '05 #2
Hi,

Unfortunally there is no way of doing that, at least in that way, as
HelpProvider is a Component it does not is included in the Controls
collection, nor in any collection like Components where all the components
are listed

There is a components collection but it does not include ALL the components
that you include, I'm not very clear of why some are include and some not,
HelpProvider is not btw.

with that in mind then you have only one way to do what you want,
Reflection, this only works IF the class has a member of that type ( it will
works if you use the designer to include the HelpProvider)

of course, you could always create a property that return it, or null if the
form does not support it.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Susan" <Su***@discussions.microsoft.com> wrote in message
news:5C**********************************@microsof t.com...
I'm trying to get the list of all of the controls on a form which works great except for getting the name of the HelpProvider. For instance:
for (int i = 0; i < this.Controls.Count; i++)
{
temp = this.Controls[i].Name;
}
will give me all of the textboxes, treeviews, etc on a form, but will not
give me the name of the helpprovier. Any suggestions of how to do this?

Thanks!

Nov 16 '05 #3

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

Similar topics

1
2669
by: kkrizl | last post by:
I have a form that displays general information about an alarm permit location. There's a subform that shows detailed information about burglar alarms that have gone off at the location. When a...
3
4037
by: Roger | last post by:
Hi In a Windows forms application I have 2 forms A and B; Form B inherits from form A. Form A is never displayed and its only purpose is to be inherited from and therefore contains mostly...
1
1997
by: Joel Reinford | last post by:
I am loading a checkbox list on a web form at runtime along with several other controls. I am unable to get to the checkbox list on postback, I always get an invalid cast exception. I have no...
5
11429
by: Kay | last post by:
Hello, I have two list boxes on my form, one initially displays with items and the other displays blank, by clicking a button, it is possible to move items from one box to another and vice a...
2
1666
by: Adam Right | last post by:
Hi, I want to get the controls of the windows form. I know that form.Controls give me the list of controls but i have a problem. For example, the toolstripmenu control cannot be reached with...
3
1423
by: sajin | last post by:
Hi All, I developed a windows form application which shows initial form which contain many labels , datagridview and List View etc . I show the thumbnail view of the word templates in the list...
4
13345
by: Toze | last post by:
I'm using a assembly to load my apllication (ex: Mobi.exe), and now I need to list all forms in my apllication and list all controls (ex: txtname;btnname) inside of each form.
4
6196
by: AshishMishra16 | last post by:
HI friends, I am using the Flex to upload files to server. I m getting all the details about the file, but I m not able to upload it to Server. Here is the code i m using for both flex & for...
0
7124
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7385
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3195
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.