Still can't understand very clearly. However if you want,

On MainForm -> Button1 Click -> Open ChildForm -> But MainForm does
NOT loose focus and ChildForm open in background

Then,

// MainForm.Button1 Click event Handler
private void button1_Click(object sender, EventArgs e)
        {
            ChildForm frmNew;
            frmNew = new ChildForm();
            frmNew.Show();
            this.Focus();
            this.Activate();
        }

What happens is that whenever a form is shown it gets focus, and the
previous window (which shows the form) goes in background. So the
above code will create the ChildForm instance and will display it but
then immediately the same form (MainForm) will get focus.

You are using term "does NOT allow access", are you displaying your
ChildForm as a Dialog? otherwise you can access the parent form by
just clicking on it.

On Sep 9, 11:56 am, Raven <[EMAIL PROTECTED]> wrote:
> Thank you very much for your replies.
>
> @sallushan
> The exit button is on MainForm. But when ChildForm is opened it
> doesn't loose focus and prevents me from accessing MainForm and exit.
> It is not really a matter because if i want to exit İ would close all
> the windows. But the main problem is i can not activate which form i
> want.The last opened form doesnt allow me to access any other form
> opened before it.
> You can think of child forms using same layouts and connecting
> different databases querying same information.For example ChildFormA
> accessing DatabaseA and ChildFormB accessing DatabaseB(which is backup
> of DatabaseA). Since they are structurally equivalent I thought I can
> use multiple instances of same form class. But my problem is when i
> open ChildFormA, i can not open ChildFormB because ChildFormA doesnot
> loose focus and prevent access to MainForm thus i cannot create
> ChildFormB. (Two forms are for the sake of simplicity, I must be able
> to choose from DatabaseK ,DatabaseL,... and compare them
> simultaneously)
>
> @Glenn: I will look into MDI thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web 
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---

Reply via email to