Questions tagged [showdialog]

360 questions
55
votes
11 answers

Is it possible to use ShowDialog without blocking all forms?

I hope I can explain this clearly enough. I have my main form (A) and it opens 1 child form (B) using form.Show() and a second child form (C) using form.Show(). Now I want child form B to open a form (D) using form.ShowDialog(). When I do this, it…
Jon Tackabury
  • 42,888
  • 45
  • 121
  • 164
33
votes
3 answers

When would ShowDialog() return null?

WPF's Window.ShowDialog method returns a nullable boolean. So does CommonDialog.ShowDialog. Now, I understand cases where these would return false (user clicked Cancel or pressed Esc), and when they would return true (code sets Window.DialogResult…
Joe White
  • 87,312
  • 52
  • 206
  • 320
32
votes
3 answers

How to check if dialog is displayed or display multiple dialogs of the same type?

I'm managing dialogs by showDialog/dismissDialog/removeDialog. I want to: Display several dialogs in kind of a stack: a) First dialog is shown using showDialog(DIALOG_TYPE) b) Next dialogs are shown on top of the existing dialog Now I'm only able…
pixel
  • 21,352
  • 30
  • 113
  • 196
31
votes
1 answer

How to show another window from mainwindow in QT

Platform: QT, Windows XP I am new to Qt. I want to show another window(what to do to open it as dialog) from mainwindow. I did "add New Item ->Qt Designer Form Class", named it say MyWindow. But how to show this MyWindow from mainwindow ?
Samir
  • 3,413
  • 7
  • 30
  • 40
26
votes
5 answers

Modal Dialog not showing on top of other windows

I am using Window.ShowDialog() to open a modal window in my WPF (MVVM) application, but it lets me navigate to other windows using the Windows taskbar (Windows 7). Consider this: I have 3 non-modal windows open in my application. Now One of these…
Pratz
  • 299
  • 1
  • 3
  • 5
16
votes
5 answers

Prevent ShowDialog() from returning when OK button is clicked

I have a dialog that I want to prevent from closing when the OK button is clicked, but it returns, and that even if the AcceptButton property is set to none instead of my OK button. What is the best way to stop it from closing?
user1151923
  • 1,632
  • 5
  • 22
  • 41
15
votes
1 answer

Dialog Window Gets Lost Behind Other Windows

I'm new to WPF so this is probably a pretty easy problem. I open a dialog window using ShowDialog(). Then, if I click into another window that's fullscreen or just covers my dialog, it's difficult to get back to the dialog. The icon that shows up…
Jason
  • 1,596
  • 2
  • 13
  • 22
15
votes
2 answers

WPF ShowDialog returns null immediately on second call

I think this is a bug in the WPF framework, without going into depths of my program and why I am doing what I am doing, I wrote a simple test application to prove my theory. Can this issue be confirmed? What are possible workarounds for a series of…
Shaun Kiesewetter
12
votes
2 answers

Which is a better way to call Form.ShowDialog()?

Which is a better way to show a modal dialog? form1 frm=new form1(); frm.showDialog() or (new form1()).showDialog();
Stack Overflow
  • 159
  • 1
  • 2
  • 6
11
votes
3 answers

Switching between Forms in C#

When the autogenerated code for my program starts, it calls Application.Run(new Form1()); and starts Form1. I have another form I'd like to switch to and close Form1 at the same time. The problem is if I use "this.Close()" in Form1 before I call…
rumsey
  • 131
  • 1
  • 2
  • 5
9
votes
7 answers

What's wrong with my cross-thread call in Windows Forms?

I encounter a problem with a Windows Forms application. A form must be displayed from another thread. So in the form class, I have the following code: private delegate void DisplayDialogCallback(); public void DisplayDialog() { if…
Arseni Mourzenko
  • 45,791
  • 28
  • 101
  • 185
7
votes
7 answers

ShowDialog() behind the parent window

I am using ShowDialog() with WindowStyle = WindowStyle.SingleBorderWindow; to open a modal window in my WPF (MVVM) application, but it lets me navigate to parent window using the Windows taskbar (Windows 7). I've found an answer here: WPF and…
Oszkar
  • 1,323
  • 3
  • 11
  • 16
7
votes
2 answers

Set UpdateSourceTrigger to Explicit in ShowDialog (WPF MVVM)

I saw this example - Binding.UpdateSourceTrigger Property in the example the UpdateSourceTrigger set to Explicit and then in the view code he call to UpdateSource of the TextBox name. But if i use the MVVM dp i dont want to have names to my…
Maya
  • 959
  • 4
  • 11
  • 18
7
votes
3 answers

ShowDialog method hangs without showing the window ¿Deadlock?

We have a WPF busy window indicator. It is shown on the main thread using a window.ShowDialog(). On response to the Loaded event an action is executed and the window is closed so the application continues its work. The window.ShowDialog() seems to…
Ignacio Soler Garcia
  • 20,097
  • 26
  • 114
  • 195
7
votes
3 answers

WPF ShowDialog and ElementHost

is it possible to display a Modal Window from a WPF User Control, that is a child of an ElementHost, and set the owner/parent of the Modal Window to the containing Form control? I'm guessing you can't do this, as the Owner property takes an instance…
James
1
2 3
23 24