473,670 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.net Dhowdialog form close on clicking on message box


HI i am opening a form as showdialog

In amin form MDI
Private Sub ToolStripMenuIt em5_Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles ToolStripMenuIt em5.Click
Try
Dim _ConnConfig As New ConnConfig
_ConnConfig.Sho wDialog()
Catch ex As Exception
MsgBox(ex.Messa ge)
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.EventArg s) 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.Sho w() instead
of _ConnConfig.Sho wDialog()

Regards
Abhishek Jain

Jul 26 '07 #1
1 3774
<ge*********@gm ail.comschrieb
>
HI i am opening a form as showdialog

In amin form MDI
Private Sub ToolStripMenuIt em5_Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles ToolStripMenuIt em5.Click
Try
Dim _ConnConfig As New ConnConfig
_ConnConfig.Sho wDialog()
Catch ex As Exception
MsgBox(ex.Messa ge)
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.EventArg s) 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.Sho w() instead
of _ConnConfig.Sho wDialog()

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2503
by: sshuangw | last post by:
Hello: I am encountering a very weird issue with MDI child, Overriden WndProc function and hidden form. Basically, the application has two forms, Form1(parent form), Form2(Child form), Form2's WndProc method is overriden, if the message is CLOSE message, just hide the form. I first initialize and show the child form, then close it by clicking the Close(X) button, the overriden WndProc method gets invoked, and the form is hidden. Then
0
2450
by: dlieu | last post by:
I've found an odd situation in where the Load event of the active form fires (after the Unload event) when Access is closed. I am able to reproduce this situation in Access 2002 SP3 and Access 2003 on computers running WinXP. This does not appear to happen in Access 2000 on a computer with Win2000. This only seems to happen if there is a hidden form also loaded and, so far, I'm only able to reproduce this if the forms are loaded through...
1
2604
by: sea | last post by:
I have Access 2002 and I am writing this application with a custom menu bar that has a print preview button -- the start up options hide the design window. The problem is that when an open form is viewed in print preview mode by clicking the print preview button, and later closed by clicking on the control X in the top right corner of the preview window, the form simply closes out and there is no more form to be seen, just a blank screen....
5
73205
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
3
7395
by: Brian Keating EI9FXB | last post by:
Hello again, I've already placed a few posts on this topic. This time i've a simple application that exhibits my problem, I've placed sample solution 8k on my website should anyone be interested in having a look. http://briankeating.net/transfer/test.zip To recap the problem I expected (and found). I've a main GUI thead (main form), this GUI thread has an UpdateTextBox function that appends a string in a textbox and It also has a button...
3
2101
by: Kaur | last post by:
Hi, I would appriceate any help to correct the code error that I am getting for the onclick event of a cmd button. I have two forms. Main Form "frmQuestion" and form 2 "SfrmQuestion". FrmQuestion shows the details about Question and by clicking on one for the cmd button on this form opens up SfrmQuestions that lets me add new questions. The frmQuestion Form remains opened at the backend. My problem is when I save the question in...
7
2630
by: Steve | last post by:
I have a method that creates of new form each time its called do i need to dipose of the form when it closes or doe the garbage collector take care of it? code private void button1_Click(object sender, EventArgs e) { frmImportData ImportData = new frmImportData();
11
5287
by: Zytan | last post by:
I have created a new form from the main form. When I close the main form with the 'x' close button, its Form.FormClosed event is run, but not the dialog's. Is this normal? It is ok / dangerous? How can I force shutdown code within the dialog's Form.FormClosed event run? Zytan
2
4323
by: Del | last post by:
I have a popup form that consist of a single field called EnteredBy and a Subform that has three fields. The popup form also has a button in the Form Footer called close. In the On Click event I have the following code. DoCmd.Close I want the EnteredBy field to be a required field. So in the On Exit event for that field I have the following code.
0
8471
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8903
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8815
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8661
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7421
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4213
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2802
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1795
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.