473,795 Members | 3,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form.ShowDialog () overloads

I am not grokking the difference between Form.ShowDialog () and
Form.ShowDialog (this). I have a form (parent form) that kicks off a
modal dialog using Form.ShowDialog (). The modal dialog has a 3rd party
control on it. The weird thing is that I can click on parent form's
icon in the taskbar and it will bring up the parent form (obscuring the
modal form). I can't do anything on the parent form (e.g. it does not
take mouse or keyboard input), so to users it looks hung.

If I only have native controls on the modal form, I do not see this
behavior (e.g. cannot bring up the parent form while the modal form is
showing).

The odd thing is that if I call the modal form using
Form.ShowDialog (this), the application behaves properly.

So it's probably something to do with the 3rd party control. Could it
be messing (is it even possible) with the ownership of the form?

Thanks.
Jun 6 '07 #1
1 2324
On Wed, 06 Jun 2007 10:46:00 -0700, Frank Rizzo <no**@none.comw rote:
[...]
So it's probably something to do with the 3rd party control. Could it
be messing (is it even possible) with the ownership of the form?
Yes. The parameterless ShowDialog() simply uses a "default" parent. When
you have the 3rd party control, this default parent is something other
than the parent form, causing the behavior you see.

For what it's worth, the default parent is whatever the "currently active
window" is. Obviously in the case of the 3rd party control, there's some
extra window running around that is treated as the "currently active
window". Assuming the 3rd party control is really just a control, this
seems wrong to me, but then there's lots of 3rd-party stuff out there
that's wrong.

Anyway, you found the appropriate work-around. When you care what the
parent is, you need to set it explicitly.

Pete
Jun 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1616
by: Chris | last post by:
Hi, I followed the the aricle http://support.microsoft.com/default.aspx?scid=kb;en-us;321525 and was able to execute a dts package in vb.net. I replaced all the "Console.WriteLine" with "msgbox". The problem I am having is that on my form I added a listbox control and I created a sub that added entries to the list box Public Sub addListItems(ByVal sItem As String)
4
9102
by: C M Shaw | last post by:
I have a form which I want to show modally; it's a fairly old form that's been ported up several versions of VB, and I'd like to keep its rewriting to a minimum. Basically, it is used in this sequence: 1. The form is shown. The Form_Load event does some initialization. 2. Further parameters are passed to this form. 3. We actually need this form to be modal, so we hide it and show it again modally. 4. Stuff happens on the form based...
4
5230
by: trialproduct2004 | last post by:
Hi all I am new to vb.net application. I am using showdialog property of form to display form. First time it is working properly. But next time it is giving me error that ' object reference not set to an instance of an object'. When i went through stacktrace, i found that it is giving error in showwindow. I am not getting why it is happening.
5
10909
by: Miro | last post by:
I will try my best to ask this question correctly. I think in the end the code will make more sence of what I am trying to accomplish. I am just not sure of what to search for on the net. I have a form that has a button. ( this form is a child form of a parent form ( main form ). Anway...in this child form I have a button, and if clicked a bunch of code will get executed. I would like to show a Progress Bar / form in modal/ShowDialog...
1
1038
by: gs | last post by:
I have an about form I want to use also as splash form. however when invoked from the above I want to provide additional info that is not accessible when being used as splash is this possible?
9
3878
by: MikeB | last post by:
Hi, I'd appreciate some help, please. I'm writing a VS2005 VB project for school and one of the requirements is that every screen should have a "Help" button. I could do it by writing a clumsy case statement like this: sub showHelp(byval frm as String) Select Case (frm) Case "Form1" dim help as new Form1
7
16294
by: pooba53 | last post by:
I am working with VB .NET 2003. Let's say my main form is called Form1. I have to launch a new form (Form2) that gathers input from the user. How can I pass variable information back to Form1 before calling the Me.close() on Form2? -Stumped
4
1957
by: hzgt9b | last post by:
Using VS2005, VB.NET, I have am developing a windows app that has a login form. This login form can be called by several classes. When the login form is able to verify that the supplied credentials are valid then I want to pass an object (System.Net.Credential) back to the calling/parent class. All the classes that call the login form have a public property named "_oCredentials" that could be used to store validated credentials. My...
8
1023
by: Ed Bitzer | last post by:
I am trying to avoid global variables and take advantage of OOP and now understand how to pass a variable to another form using a constructor. But how to I return that variable if changed on Form 2? Ed
0
9672
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
9519
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
10000
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
9037
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
6779
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
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
4113
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
3721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
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.