468,283 Members | 1,781 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,283 developers. It's quick & easy.

VB.net Dhowdialog form close on clicking on message box


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
1 3596
<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.

Similar topics

3 posts views Thread by Brian Keating EI9FXB | last post: by
7 posts views Thread by Steve | last post: by
11 posts views Thread by Zytan | last post: by
reply views Thread by NPC403 | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.