child form doesn't appear in the task bar

  • Thread starter Zeev Bunich via .NET 247
  • Start date
Z

Zeev Bunich via .NET 247

I have 2 forms Form1 and Form2
Form1 is the owner of Form2 and should activate it on Button1_Click


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Create another form and display it
Dim newForm As New Form2
newForm.Show()
newForm.Owner = Me
' Hide the owner
Me.Hide()
End Sub

in the Form2 we have:

Private Sub Form2_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Me.Owner.Show()
End Sub


Evrerything works fine but Form2 doesn't appear in the taskbar
and if it's minimized there is no way to get to it but with ALT+TAB or TASK Manager

Is there some workaround for this , except for removing the maximize minimize box?

I know it's a newbie question,Any help would be appreciated

Thanks
 
S

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

Hi Zeev,

Are you sure that you haven't set Form2's ShowInTaskbar to false. Otherwise
it works fine with me

--

Stoitcho Goutsev (100) [C# MVP]


Zeev Bunich via .NET 247 said:
I have 2 forms Form1 and Form2
Form1 is the owner of Form2 and should activate it on Button1_Click


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' Create another form and display it
Dim newForm As New Form2
newForm.Show()
newForm.Owner = Me
' Hide the owner
Me.Hide()
End Sub

in the Form2 we have:

Private Sub Form2_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
 
R

Ravickumar M - MVP

Hi,

if you want to hide the form1 and only show form2 after it is launched from
the form1 why you need to have the form2 as the child form.

if my understanding is correct while the form2 is being closed you need to
get the form1 back. if this is the scenerio then you need not to have the
form2 as the child, instead pass the reference of your form1 to the form2
and in the closing event of the form2 to you can use the reference of the
form1 to show it again.

Regards

Ravickumar M

Zeev Bunich via .NET 247 said:
I have 2 forms Form1 and Form2
Form1 is the owner of Form2 and should activate it on Button1_Click


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' Create another form and display it
Dim newForm As New Form2
newForm.Show()
newForm.Owner = Me
' Hide the owner
Me.Hide()
End Sub

in the Form2 we have:

Private Sub Form2_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
 

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