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 8553239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:36:23+00:00 2026-06-11T14:36:23+00:00

I have a form which is based on another standard form I have (transparency

  • 0

I have a form which is based on another standard form I have (transparency supported form) which at runtime identifies itself by its own type. In the designer however, I have set up some message box outputs that show at design time it identifies on top of the designer control stack as the parent type.

Example code

Public Class SpecificForm
    Inherits GenericForm
    Implements IUsefulInterface
    ...
End Class

Public Class GenericForm
    Inherits System.Windows.Forms.Form
    ...
End Class

I have controls on the form that seek their parent to know how to draw correctly. At runtime it works fine since the specific type implements an interface carrying drawing information. Cycling through the parents yields

"Control1" As System.Windows.Forms.Control, parented by
"MainForm1" As SpecificForm, parented by
Nothing

as design time though cycling through the parents yields

"Control1" As System.Windows.Forms.Control, parented by
"MainForm1" As GenericForm, parented by
"" As System.Windows.Forms.Design.DesignerFrame+OverlayControl, parented by
"" As System.Windows.Forms.Design.DesignerFrame, parented by
"" As System.Windows.Forms.Control, parented by
Nothing

at runtime MainForm identifies as the SpecificForm type, at design time is is understandably hosted by the designer, but it now identifies as the GenericType.

  • 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-06-11T14:36:24+00:00Added an answer on June 11, 2026 at 2:36 pm

    Also, to further document what you are seeing, you can do the following experiment:

    Create a simple UserControl called FooUserControl which simply will be used to show a message box with the stack trace of the place where it was created:

    using System;
    using System.Windows.Forms;
    
    namespace Test {
        public partial class FooUserControl : UserControl {
            public FooUserControl() {
                InitializeComponent();
                MessageBox.Show(Environment.StackTrace);
            }
        }
    }
    

    Build your project and now open any of your form designers, for example, to the desginer of a form called FooForm (it could be the designer of your SpecificForm or any other control you are authoring.) The moment that you drag and drop this FooUserControl on the designer surface you will see a message box saying something like;

    enter image description here

    And every time you re-open this designer you will see something like:

    enter image description here

    Whereas, every time you “run” you application you will see something like:

    enter image description here

    All this is saying, is that the Windows Forms designer is NOT even executing any such method called FooForm.InitializeComponent(). That method is executed only at runtime, since it’s only at runtime when the constructor of your control being designed is executed, which in turn calls FooForm.InitializeComponent().

    Believe it or not, what the designer is doing is essentially parsing statement by statement the lines in the FooForm.Designer.cs file (probably using CodeDOM).

    Hope these explanations help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form which POST's its data via AJAX: $.ajax({ type: POST, url:
I have a problem in creating an AJAX-based form submission which if its response
I have a form which has elements in a couple of divs. Based on
I currently have a form based login in my application which is developed on
I have a list of type A, in which each element contains another list
I have a form in which the user can choose a component type from
I have a standard form in MS-Access which lists a bunch of orders, and
I have a PHP based form. It has a drop down list which fetches
I have made a Base Form which is inherited by most Forms in the
I have a base and derived class called Node which form elements of a

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.