473,659 Members | 2,765 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.C ount; 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 12962
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 "InitializeComp onent()" 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.C ount; 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***@discussi ons.microsoft.c om> wrote in message
news:5C******** *************** ***********@mic rosoft.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.C ount; 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
2693
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 new alarm is entered on the subform, I want to print a report that shows the general information and the alarms that were entered. The record source for the form is the Mailing List table (key is Alarm #). The record source for the subform is the...
3
4045
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 public/protected methods that I have created (as well a few controls that inheriting forms may use). In my method on form A (public virtual void setcontrols()) I need a list of all controls on the instantiated form (in this example form B). Form B has a...
1
2003
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 trouble getting the other controls including a dropdown list. Any suggestions on what I could do would be appreciated. Joel Reinford
5
11446
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 versa, this works fine. I also have a dropdown list on the page with autopost back = true, my problem is as follows: when the user selects an option in the dropdown list the form is posted back to the server and certain other processing happens, then...
2
1677
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 that way. My goal is to list the items of the toolstripmenuitem on the form. I have only the typename of the windows form so i am invoking the form with its typename, and i can reach the controls like buttons,labels etc. But i cannot get the...
3
1429
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 view , when i double click in the thumbnail view ,the templates open in word , but when i close the word and i go back to my form , all the controls are becoming white space ( meaning its getting crashed ) How can i prevent this problem , am i...
4
13351
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
6213
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 Struts: import java.io.File; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator;
0
8339
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8629
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2757
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 we have to send another system
2
1739
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.