Error in documentation or error in .NET.

I recently searched for how to open a file browser dialog when I came across this documentation . Now, looking at an example, it shows:

if(openFileDialog1.ShowDialog() == DialogResult.OK) 

However, if I print this, Intellisense will not recognize OK . In fact, this is not even an option. I need to use:

 if(openFileDialog1.ShowDialog() == true) 

Am I missing something stupid or is this an oversight in the documentation?

+4
source share
1 answer

You are looking for documentation for the Windows Forms Form.ShowDialog .

I suspect you're really using WPF, where Window.ShowDialog returns a Nullable<bool> .

+16
source

Source: https://habr.com/ru/post/1488359/


All Articles