Form2 alwasy on Form1

A

A-PK

Hi,
I got two forms, named form1 and form2
when i click on form1, the form2 by default by display under form1.
is there a way that able to show form2 all the time even if i click on form1
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi,
Make the form1 owner of form2.
form2.Owner = form1;
This way form2 will be always on top of form1. form2 will hide when you
minimize or hide form1.
By default form2 is not shown on the task bar. If you want to have it on the
task bar you should set ShowInTaskBar to true. However even if you do the
last when you minimize form1 form2 will disappear form the task bar.
 
H

Herfried K. Wagner [MVP]

* " A-PK said:
I got two forms, named form1 and form2
when i click on form1, the form2 by default by display under form1.
is there a way that able to show form2 all the time even if i click on form1

\\\
Dim f As New Form2()
f.ShowDialog()
///
 
A

A-PK

yes, able to do that : )

but another new problem found
if I click the form2 again and again, but form2 will appear again in new as
new form2 again and again.

if form2 already display, then do nothing,
else
display form2
end if

any idea how to detect the above concept ?

Stoitcho Goutsev (100) said:
Hi,
Make the form1 owner of form2.
form2.Owner = form1;
This way form2 will be always on top of form1. form2 will hide when you
minimize or hide form1.
By default form2 is not shown on the task bar. If you want to have it on the
task bar you should set ShowInTaskBar to true. However even if you do the
last when you minimize form1 form2 will disappear form the task bar.

--
B\rgds
HTH
100 [C# MVP]

A-PK said:
Hi,
I got two forms, named form1 and form2
when i click on form1, the form2 by default by display under form1.
is there a way that able to show form2 all the time even if i click on form1
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi A-PK,

Sorry, but I didn't get your question. Could you elaborate on that a bit?

--
B\rgds
100 [C# MVP]

A-PK said:
yes, able to do that : )

but another new problem found
if I click the form2 again and again, but form2 will appear again in new as
new form2 again and again.

if form2 already display, then do nothing,
else
display form2
end if

any idea how to detect the above concept ?

Stoitcho Goutsev (100) said:
Hi,
Make the form1 owner of form2.
form2.Owner = form1;
This way form2 will be always on top of form1. form2 will hide when you
minimize or hide form1.
By default form2 is not shown on the task bar. If you want to have it on the
task bar you should set ShowInTaskBar to true. However even if you do the
last when you minimize form1 form2 will disappear form the task bar.

--
B\rgds
HTH
100 [C# MVP]

A-PK said:
Hi,
I got two forms, named form1 and form2
when i click on form1, the form2 by default by display under form1.
is there a way that able to show form2 all the time even if i click on form1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top