By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,259 Members | 1,708 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,259 IT Pros & Developers. It's quick & easy.

VB.net Dhowdialog form close on clicking on message box

P: n/a

HI i am opening a form as showdialog

In amin form MDI
Private Sub ToolStripMenuItem5_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ToolStripMenuItem5.Click
Try
Dim _ConnConfig As New ConnConfig
_ConnConfig.ShowDialog()
Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub

Now suppose i generate a msgbox on connconfig form then if i click on
msg box ok my form
closes why
In conn config form
Private Sub command1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles command1.Click
msgbox "hi"
end sub
Problem : on clicking Ok on msgbox Form closes
It wont close if in main form i open as _ConnConfig.Show() instead
of _ConnConfig.ShowDialog()

Regards
Abhishek Jain

Jul 26 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
<ge*********@gmail.comschrieb
>
HI i am opening a form as showdialog

In amin form MDI
Private Sub ToolStripMenuItem5_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ToolStripMenuItem5.Click
Try
Dim _ConnConfig As New ConnConfig
_ConnConfig.ShowDialog()
Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub

Now suppose i generate a msgbox on connconfig form then if i click
on msg box ok my form
closes why
In conn config form
Private Sub command1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles command1.Click
msgbox "hi"
end sub
Problem : on clicking Ok on msgbox Form closes
It wont close if in main form i open as _ConnConfig.Show() instead
of _ConnConfig.ShowDialog()

In ConnConfig, what is the value of the DialogResult property of Command1?
If it is not "None", then the Form automatically closes if you click the
button (because the DialogResult property of the Form is set automatically,
which exits ShowDialog).
Armin

Jul 26 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.