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

  • SEARCH
  • Home
  • 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 8350751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:25:10+00:00 2026-06-09T08:25:10+00:00

Still learning c#. I am creating an ObjectListView, and this among other things is

  • 0

Still learning c#. I am creating an ObjectListView, and this among other things is capturing button clicks.

    public partial class MainForm : Form
    {
    private FormSpecParser parser;
    private static ObjectListviewForm form;

    public MainForm()
    {
        InitializeComponent();
        createMainForm();
    }

    private void createMainForm()
    {
        form = new ObjectListviewForm();
        form.Populate(parser.ParsedSpec);
        form.Show(this);
        }
    }


public partial class ObjectListviewForm : Form
{
    ...
        void b_Click(object sender, EventArgs e)
        {
            Button b = sender as Button;
            if (b == null) return;
            var button = GetFormSpecButton(b.Name);

            MessageBox.Show(button.ClickMessageBoxStub);
        }
}

I have 2 problems: 1) how do I get the ObjectListView to tell MainForm that a button was clicked, please deal with it.

2) I want the ObjectListView Form to be the first one the user sees, and when the ObjectListView form closes, the program closes. Right now the ObjectListView Form does appear, but “behind” it is a blank form, and when ObjectListView Form is closed, control seems to pass back to this blank form instead of exiting.

  • 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-09T08:25:15+00:00Added an answer on June 9, 2026 at 8:25 am

    1) You passed MainForm as Owner to Show method – form.Show(this). This means that in ObjectListviewForm you can call method from MainForm like this:

    (this.Owner as MainForm).MethodInMainform();
    

    2) In Program.cs file You should have line like this:

       Application.Run(new MainForm());
    

    change it to:

    Application.Run(new ObjectListviewForm ());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm still learning how to use SQL, and I need some help creating this
First, I'd like to apologize, I'm still a beginner. For learning purposes I'm creating
Still learning Objective-C / iPhone SDK here. I think I know why this wasn't
Still learning WPF....thanks for any help. Is there any way to Refactor this: <ListBox
Still learning CSS so pardon if this is obvious - I am building a
Still learning JSP Web Applications here. I have been doing this for a while
This might be a silly question but I am still learning. I have read
Still learning my ways around C# generics... is it possible to achieve this functionality?
Still learning the ropes with Groovy, this problem has tripped me up since last
I'm sorry if this is a very simplistic question but I'm still learning the

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.