Question Open a child form - Main form is unresponsive

Gopher2011

Well-known member
Joined
Mar 3, 2011
Messages
111
Location
South England
Programming Experience
10+
When I open my child form,

frm_Analogs.ShowDialog()

It opens up the new form, but now I can not interact with my main form. It will not accept focus or allow me to interact with it.

Do I need to change the form type?

Any Ideas?
Thanks In advance.
 

Gopher2011

Well-known member
Joined
Mar 3, 2011
Messages
111
Location
South England
Programming Experience
10+
Hmm I have no idea why but to fix it i added an instance to the class

Public Class frm_Main
Dim frmAnalogs As New frm_Analogs()


and opened it with

Private Sub ToolsTSMI_Analogs_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolsTSMI_Analogs.Click
frm_Analogs.Show()
End Sub

This seemed to fix it. But I am unsure why.
 

InertiaM

Well-known member
Joined
Nov 3, 2007
Messages
663
Location
Kent, UK
Programming Experience
10+
Your first code used ShowDialog, and your second used Show. That's the difference :)
 

jamesvick

Active member
Joined
Jul 19, 2010
Messages
34
Programming Experience
1-3
dialog window does not allow focus to other windows. When you click on save as in file menu in firefox try to click anywhere on the webpage - it plays a beep. The save dialog is a dialog - same behaviour.
 

Gopher2011

Well-known member
Joined
Mar 3, 2011
Messages
111
Location
South England
Programming Experience
10+
Hey thanks guys. I thought all this was set in the form properties... I am beginning to understand. Behind the hood, there is a inherent class override going on. I can open it as a dialog or as a separate form, depending on how I call it.
 
Top Bottom