473,769 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Finding name of all forms

Finding name of all forms

I want to create a procedure that can loop trough all objects of type form
in an application and print the name property to the debug window.

TIRislaa
Nov 21 '05 #1
6 1089
"Tor Inge Rislaa" <no************ *@rislaa.no> schrieb:
I want to create a procedure that can loop trough all objects of type form
in an application and print the name property to the debug window.


You'll have to write and maintain your own forms collection.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2
he should have reread book again

Herfried K. Wagner [MVP] wrote:
"Tor Inge Rislaa" <no************ *@rislaa.no> schrieb:

I want to create a procedure that can loop trough all objects of type form
in an application and print the name property to the debug window.


You'll have to write and maintain your own forms collection.


Nov 21 '05 #3
What book are you talking about?
"Supra" <su*****@rogers .com> skrev i melding news:O8******** ******@TK2MSFTN GP10.phx.gbl...
he should have reread book again

Herfried K. Wagner [MVP] wrote:

"Tor Inge Rislaa" <no************ *@rislaa.no> schrieb:
I want to create a procedure that can loop trough all objects of type form
in an application and print the name property to the debug window.

You'll have to write and maintain your own forms collection.
Nov 21 '05 #4

"Tor Inge Rislaa" <no************ *@rislaa.no> wrote
Finding name of all forms

I want to create a procedure that can loop trough all objects of type form
in an application and print the name property to the debug window.


Try this:

Dim item As Type
For Each item In System.Reflecti on.Assembly.Get ExecutingAssemb ly.GetTypes
If GetType(Form).I sAssignableFrom (item) Then
Debug.WriteLine (item.Name)
End If
Next

LFS
Nov 21 '05 #5
"Larry Serflaten" <se*******@usin ternet.com> schrieb:
I want to create a procedure that can loop trough all objects of type
form
in an application and print the name property to the debug window.


Try this:

Dim item As Type
For Each item In System.Reflecti on.Assembly.Get ExecutingAssemb ly.GetTypes
If GetType(Form).I sAssignableFrom (item) Then
Debug.WriteLine (item.Name)
End If
Next


Oh, I thought about all form /instances/ ;-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #6
Herfried,

As always you answered directly on the question from the OP, however
probably the answer as Larry did it is the right answer for the problem.
However that is not 100% sure because Tor is asking for Objects and not for
types/classes.

:-)

Cor

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at>
"Larry Serflaten" <se*******@usin ternet.com> schrieb:
I want to create a procedure that can loop trough all objects of type
form
in an application and print the name property to the debug window.


Try this:

Dim item As Type
For Each item In System.Reflecti on.Assembly.Get ExecutingAssemb ly.GetTypes
If GetType(Form).I sAssignableFrom (item) Then
Debug.WriteLine (item.Name)
End If
Next


Oh, I thought about all form /instances/ ;-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #7

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

Similar topics

5
4389
by: Mike | last post by:
Hi I've written a module to find the first occurrence of a record in a query (that is my forms datasource) that matches four specified criteria. No matter what I try it doesn't seem to find records even though they are in the recordset as you can navigate to them using the forms navigation buttons. weekending, weekday, ba (business area), projected Here's the module can anyone spot where i'm going wrong? Any suggestions would be...
10
7032
by: Dixie | last post by:
I need to delete some relationships in code. How do I know what the names of those relationships are?
8
2015
by: Rick Strahl [MVP] | last post by:
Hi all, I'm building an app that uses the ASP.Net runtime... One problem I've run into is that pages running inside of the runtime are not finding DLLs in the GAC. In fact, if I look at the debug trace of the search path it searches the bin directory and Temporary ASP files but not the GAC. A simple example I used was trying to load System.Windows.Forms. If I add a
12
5418
by: Mike Smith | last post by:
Hey anyone knows how to find an item in a list view based on text ? Cant seem to get the IndexOf method working. would the LVM_FINDITEM method using SendMessage API work in .Net ?
3
1095
by: Tor Inge Rislaa | last post by:
Finding name and type In the activate procedure of a form I want to write to the debug window, name and type of all controls at that actual form. Is there a smart way to do that? Allso for the entire application I want to print the name of all forms to the debug window. TIRislaa
14
2036
by: kelvin.jones | last post by:
Hi, if I had the ID of an input element, how can I find the input's FORM in javascript? Basically, given a input's dom id, I want to insert something in the onSubmit of the Form that that input is in. I want to avoid making the user have to submit the form's id if possible. Let me know if my question is unclear...thanks! Kel
4
1411
by: bg_ie | last post by:
Hi, I have an Access document which I've been asked to debug and update a little. The problem is that i can't find where one of the Forms is being called from. In other words, I can't navigate to this form by clicking on the various forms that lead to it. I can of course open it via objects>>forms. Any suggestions,
1
1538
by: Bob Simon | last post by:
I'm trying to find what what forms and reports use a particular field, because I'm replacing it with another field. How can I search forms and reports for a field name?
12
1891
by: Jeff | last post by:
As I'm learning PHP, I'm making a fair number of mistakes in syntax. In perl, you can turn on reading these errors from the browser by adding this: use CGI::Carp 'fatalsToBrowser'; Is there something like this in PHP? Or do I need to find the php.ini file and look to see where the error
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10212
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...
1
9995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
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
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5304
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3962
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

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.