Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenDialog for WPF

Tags:

I just started with WPF. Moved from Window Form.

Where do those openDialog, saveDialog gone? And a bunch of stuff.

like image 238
Athiwat Chunlakhan Avatar asked Aug 27 '09 08:08

Athiwat Chunlakhan


People also ask

How do I open a Filedialog in WPF?

You can simply double click on the Button to add its click handler. On the button click event handler, we will write code to launch the OpenFileDialog and select a text file. The Button click event handler code is listed in Listing 2. Nullable<bool> result = openFileDlg.

What is dialog box in WPF?

In this article Dialog boxes are used to: Display specific information to users. Gather information from users. Both display and gather information. Display an operating system prompt, such as print window.

How do I open a Word document in WPF?

Open word or PDF document file within WPF window. First user select document from comboBox that he\she wants to open, after the document selection file will open within window.


1 Answers

Look in Microsoft.Win32 namespace

OpenFileDialog openDialog = new OpenFileDialog(); if (openDialog.ShowDialog().Value) {       .......... } 

And the same for SaveFileDialog

SaveFileDialog saveDialog = new SaveFileDialog(); if (saveDialog.ShowDialog().Value) {       .......... } 
like image 89
Arsen Mkrtchyan Avatar answered Nov 23 '22 08:11

Arsen Mkrtchyan