Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 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 2:09am
froxy1.1K
Comments
vijay bisht at 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
0 Sergey Alexandrovich Kryukov 8,438
1 OriginalGriff 6,491
2 Peter Leow 3,567
3 Zoltán Zörgő 3,326
4 Richard MacCutchan 2,397


Advertise | Privacy | Mobile
Web04 | 2.8.150123.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2015
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