dialog

Microsoft.Office.Interop.Word.Document won't prompt to save changes to single document without _Application.Quit()

六眼飞鱼酱① 提交于 2019-12-24 12:28:01
问题 Before I begin, I have googled this to death and there are many posts about how to prevent the save prompt. I am having an issue showing the save prompt. I am building the template editing portion of a document generation system in C#. The system will edit 'dot' and 'dotx' files. Before outlining the problem, the environment I am using for development is running Visual Studio 2010 and Word 2010. It will eventually run on other versions, but i would like to get these versions functional first.

NullPointerException while changing textView text in an AlertDialog

可紊 提交于 2019-12-24 11:49:23
问题 Background: I just want to create a customDialog with a specific layout and add the content. Its a DialogFragment Code: TextView text; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); text = (TextView)getView().findViewById(R.id.lorem); text.setText("Test"); } @Override public Dialog onCreateDialog(Bundle savedInstanceState){ AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity()

Text selection tools in ActionBar are white on white background after selecting text in Dialog

半世苍凉 提交于 2019-12-24 11:37:14
问题 Anyone had this issue, that after selecting text in dialog's EditText, toolbar appears with invisible action buttons (white on white background)? How do I set theme to a DialogFragment? 回答1: You can custom dialog theme in styles.xml: <style name="MyDialogTheme" parent="android:Theme.Holo.Dialog" /> then use MyDialogTheme in your DialogFragment UPDATE In your dialog use following codes to set custom theme: ContextThemeWrapper context = new ContextThemeWrapper(getActivity(), R.style

GetOpenFileName change directory

僤鯓⒐⒋嵵緔 提交于 2019-12-24 11:35:39
问题 Question: Does anyone know how to change the current directory of an already running open file dialog? Details: I have a customized open file dialog (using a custom template to add extra controls) that also has all the validation, existing checks, and creation tests turned off (via the OpenFileName flags). Turning those things off disables the built-in behavior of the dialog that will cause it to change the currently displayed folder if the user types a folder name into the "file name" combo

Progress Download Dialog

六月ゝ 毕业季﹏ 提交于 2019-12-24 10:57:38
问题 How do you implement Progress Download Dialog based on the codes below? My codes downloads images from a specific URL then it saves the image file into SD Card and set the image as wallpaper. I want to show a Progress Download Dialog when the user touches the options menu button setwallpaper(). public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.set_wallpaper: SetWallpaper(image_url); return true; default: return false; } } public void SetWallpaper

Why does a folder dialog immediately close unless a window is displayed in WPF?

别说谁变了你拦得住时间么 提交于 2019-12-24 10:55:37
问题 I'm developing a WPF application that's meant to live in the tool tray, so it doesn't involve any windows. Right-clicking the tool tray icon brings up a menu with a Configure Report Path... option, and I'd like to display a folder browser dialog to the user when this is clicked: What I'm finding is that when the option is selected, a dialog opens and immediately closes unless I assign some window to Application.Current.MainWindow and show it before opening the dialog. This is the code I'm

JQueryMobile dialog shows twice because of a postback

穿精又带淫゛_ 提交于 2019-12-24 10:07:17
问题 I have an asp.net page with a timer embedded in an UpdatePanel (UpdateMode="Conditional", ChildrenAsTriggers="false"). The timer is responsible for updating some components of that page every few seconds. There are also some HyperLink controls on the page and they open a JQueryMobile dialog when clicked (data-rel="dialog"). The problem is that the timer i mentioned causes postback every few seconds. So when a dialog is opened and then closed, the first such postback after then causes the

force dialog input to require fullscreen ime soft keyboard in landscape

岁酱吖の 提交于 2019-12-24 10:05:49
问题 I have a dialog box with an input, I have to automatically pop up the soft keyboard, current code: final EditText input = new EditText(this); final AlertDialog dialog = new AlertDialog.Builder(ScActivity.this) .setMessage(message) .setView(input).setPositiveButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow

Let my MFC dialog receive keystroke events before its controls (MFC/Win32 equivalent of WinForms “KeyPreview”)

强颜欢笑 提交于 2019-12-24 08:46:58
问题 I have an MFC dialog containing a dozen or so buttons, radio buttons and readonly edit controls. I'd like to know when the user hits Ctrl+V in that dialog, regardless of which control has the focus. If this were C#, I could set the KeyPreview proprety and my form would receive all the keystrokes before the individual controls - but how do I do that in my MFC dialog? 回答1: JTeagle is right. You should override PreTranslateMessage() . // Example BOOL CDlgFoo::PreTranslateMessage( MSG* pMsg ) { /

Basic dialog box input for a strobe light implementation

时光总嘲笑我的痴心妄想 提交于 2019-12-24 07:32:30
问题 I have connected a photographic flash unit to my computer using a relay switch connected to the serial port. The following code causes the strobe to flash at 4Hz for 10 flashes: #include <windows.h> //Initialise Windows module int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil) { //Define the serial port precedure HANDLE hSerial; int freq = 4; int iterations = 10; int x; for ( x = 0; x < iterations; x++) { //Fire the flash (open the