473,326 Members | 2,110 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,326 software developers and data experts.

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 12941
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
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
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
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
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
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
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
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
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.