Click here to Skip to main content
12,350,451 members (24,645 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#2.0 C# VB VB.NET
Hi

I am working on windows application.
I have two windows basically.
when i open the child window,I am not able to access the main window.
I want to access both the child window and main window at time.
It should be active.
How to do that?


Regards
Froxy
Posted 12-Sep-12 1:09am
froxy1.2K
Comments
vijay bisht 12-Sep-12 8:00am
   
inspite of showdialogue use only frm.show
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You can enable the parent window using this:
private void Form_Activated(object sender, System.EventArgs e)
{
    if (this.Owner != null)
    {
        this.Owner.Enabled = true;
    }
}
Or use the following code to open your form:
Form newForm = new ChildForm();
newForm.Show(this);



--Amit
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

What do you mean by access ? Accessing the dialog as a user perspective or programmer perspective.

Anyway, considering from user perspective, it seems that you've created the Model dialog. You've to create Modeless dialog for that.

Go through this[^] article.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100