Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6820073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:22:53+00:00 2026-05-26T21:22:53+00:00

Currently I am working with: C# Windows forms application I currently have a problem

  • 0

Currently I am working with:

C#
Windows forms application

I currently have a problem specifying a domain for my foreach loop
basically I have the string literal of , for example, “TargetForm” and I need to “fetch/get” this TargetForm by name identification and drag it into my other project.

For example

Project A has foreach loop that finds the string and wants to do Application.OpenForms / or whatever works

Project B (GPC) has this form

Is there some way I can get that dynamically? Using any literal domain is not an option as many forms will be added or renamed, I need to get ALL forms in Project B no matter what the users/developers do and match that to the options I give the user in project A.

Any of this make any sense at all? I hope so, if not please help me help you.

Thanks in advance!

EDIT:

The usecase:

The primary project HAS a string value “NameOfTheFormIWantToGet”
The secondary project HAS two partial classes to build a form ( as is tradition )

The action of the matter is an iterator inside project A which uses a string literal to match for a Form object in project B, if there is a match between the string and the name of a form inside the B project, then this question can be considered answered. The rest is already history, it’s getting the domain “Look at B for forms” that I can’t figure out.

EDIT:

This link I found (after this problem was solved) explains pretty well how you can solve an assembly load target problem with code examples and step by step approach: http://www.chilkatsoft.com/p/p_502.asp

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:22:53+00:00Added an answer on May 26, 2026 at 9:22 pm

    Following source searches all types in PrjB.exe and if its a Form it is opened.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Reflection;
    using System.Windows.Forms;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                Assembly prjB = Assembly.LoadFile(@"C:\...\PrjB.exe");
                foreach (Type t in prjB.GetTypes())
                    if (t.IsSubclassOf(typeof(Form)))
                    {
                        Console.WriteLine(t.Name);
                        Form frm = (Form)Activator.CreateInstance(t);
                        frm.ShowDialog();
                    }
                Console.ReadLine();
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a Windows Forms application and I need to have a
I am currently working on a Windows.Forms application. It's basically a simple motion detection
I'm developing a windows forms application using VB.NET. I'm currently working on DataReport (by
I'm currently working on databinding some of my existing Windows Forms, and I've ran
I'm currently doing a project in C# working with windows forms. During the course
I'm working on a PyGTK/glade application that currently has 16 windows/dialogs and is about
I have a multi-threaded Delphi 6 Pro application that I am currently working on
I'm working on my project: [Beer Pong Management System][1], a Windows Forms application. I
I am currently working on a WPF application where I would like to have
I currently have a windows form application composed of a textbox and two buttons

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.