Hi, I have two forms: Form1 and Form2

In Form1 there is one button which opens form2, and when I click on Title bar of Form2 I loose Form1 focus.

I dont want this to happen. I want to click on title bar but at the same time form1 focus must not be lost.

How to do this?

Recommended Answers

All 3 Replies

When you open it, call it with ShowDialog() method, like:

Form2 f2 = new Form2();
f2.ShowDialog();

I tried this, but I m unable to click on buttons of form1 until I click Ok on form2.
I want both to be accessible!

Look to your 2nd thread, I just answered you how to use a referecne of form1 on form2. And setting topmost property.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.