showdialog

Want to display AlertDialog in onCreate of Activity - android

风格不统一 提交于 2019-12-01 14:37:32
In my activity, I call a MyDialog (custom dialog) in onCreate() and handle its DismissListener in Activity to find if its cancelled or not. If its cancelled, I finish the activity, else load the activty. During this loading time, I want to show a Alert/Progress dialog to let the user know that its loading, please wait. But am not able to see the dialog. This is how I have coded : public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ld = new AgreeDialog(this); ld.setOnDismissListener(new OnDismissListener() { @Override public void onDismiss(DialogInterface

When would ShowDialog() return null?

与世无争的帅哥 提交于 2019-12-01 13:41:03
问题 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 to true, probably in response to OK being clicked). But null? My first thought is that clicking the title bar's Close button might return null. But the docs state (and I confirmed by testing) that the title-bar Close button is treated as a Cancel.

Windows Forms and ShowDialog problem

天大地大妈咪最大 提交于 2019-11-30 21:29:39
I have a borderless Windows Forms application. The main window creates other forms (simple dialogs where I can click yes or no) with ShowDialog() . Every created dialog is not visible in the taskbar, my application has only one taskbar entry that focuses my application (and if a dialog is open that one is focused). If I use ALT + TAB to cycle to all open windows I only see one entry, too. However, if the dialog is created while my application doesn't have the focus (for example the user starts a long running task, starts to work on something else and while being in the background, my

ShowDialog() behind the parent window

我是研究僧i 提交于 2019-11-30 05:07:26
问题 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 ShowDialog() but it isn't suitable for me because I don't need an "always on top" tool window. Thanks in advance 回答1: Try setting the Owner property of the dialog. That should work. Window dialog = new Window(); dialog.Owner = mainWindow; dialog

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

女生的网名这么多〃 提交于 2019-11-30 03:49:48
问题 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 (this.InvokeRequired) { this.Invoke(new DisplayDialogCallback(DisplayDialog)); } else { this.ShowDialog(); } } Now, every time I run this, an InvalidOperationException is thrown on the line this.ShowDialog(); : "Cross-thread operation not valid: Control 'SampleForm'

showDialog in button Listview adapter

£可爱£侵袭症+ 提交于 2019-11-28 12:50:36
i have a listView like THIS i want when i press the delete. it show a dialog like this image so when i press YES. it will remove from list. here's my code.. public class customadapter extends BaseAdapter{ ArrayList<HashMap<String, String>> oslist; Context context; private Button btnDelete; private Button btnEdit; AlertDialog.Builder alertDialogBuilder; public customadapter(ArrayList<HashMap<String, String>> oslist,Context context) { System.out.println("skdjfhksdfjskfjhsdkjfh"); this.context = context; this.oslist = oslist; } @Override public int getCount() { // TODO Auto-generated method stub

Modal Dialog not showing on top of other windows

▼魔方 西西 提交于 2019-11-27 22:45:10
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 opens a modal window using Window.ShowDialog() . I also set Application.MainWindow as the owner of the modal window. This is so because I am using MVVM messaging and the message handler to open a new window is centralized in App.xaml.cs . The window does opens modally - no issues there. However, Windows 7 allows me to swtich to the other application

showDialog in button Listview adapter

假如想象 提交于 2019-11-27 19:27:09
问题 i have a listView like THIS i want when i press the delete. it show a dialog like this image so when i press YES. it will remove from list. here's my code.. public class customadapter extends BaseAdapter{ ArrayList<HashMap<String, String>> oslist; Context context; private Button btnDelete; private Button btnEdit; AlertDialog.Builder alertDialogBuilder; public customadapter(ArrayList<HashMap<String, String>> oslist,Context context) { System.out.println("skdjfhksdfjskfjhsdkjfh"); this.context =

How to show another window from mainwindow in QT

核能气质少年 提交于 2019-11-27 03:43:18
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 ? Patrice Bernassola Implement a slot in your QMainWindow where you will open your new Window, Place a widget on your QMainWindow, Connect a signal from this widget to a slot from the QMainWindow (for example: if the widget is a QPushButton connect the signal click() to the QMainWindow custom slot you have created). Code example: MainWindow.h // ... include

Is it possible to use ShowDialog without blocking all forms?

醉酒当歌 提交于 2019-11-26 18:28:51
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 blocks form A and form C as well. Is there a way to open a modal dialog and only have it block the form that opened it? If you run Form B on a separate thread from A and C, the ShowDialog call will only block that thread. Clearly, that's not a trivial investment of work of course. You can have the dialog not block any threads at all by simply running