Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 776625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:28:44+00:00 2026-05-14T19:28:44+00:00

I have written a custom dialog (form) that I can use in a C#

  • 0

I have written a custom dialog (form) that I can use in a C# program that behaves much like a “File – Open” menu command and brings up a window where a user can select a file or directory.

The question I have is this. It has “My Computer” as its root. How can I have it so that it searches on a Network? If the file or directory is located on a network.

Or better yet, in Visual Studio 2010, is there some sort of canned FileOpenDialog that I can use right away?

I tried calling the OpenFileDialog as described in the example code at
http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx
but the compiler does not seem to like DialogResult.OK as used in this line of code:

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

The compiler says:

Error 1 ‘System.Nullable’ does not contain a definition for ‘OK’ and no extension method ‘OK’ accepting a first argument of type ‘System.Nullable’ could be found (are you missing a using directive or an assembly reference?)

I tried using the namespace Microsoft.Win32 instead of System.Windows.Forms and neither worked. They both produced this error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:28:45+00:00Added an answer on May 14, 2026 at 7:28 pm

    Looks like you are trying to use a WinForms (System.Windows.Forms) dialog.
    Here is the MSDN page for WPF dialog boxes from the Microsoft.Win32 namespace.

    An excerpt:

    Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
    dlg.FileName = "Document"; // Default file name
    dlg.DefaultExt = ".txt"; // Default file extension
    dlg.Filter = "Text documents (.txt)|*.txt"; // Filter files by extension
    
    // Show open file dialog box
    bool? result = dlg.ShowDialog();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a custom MSBuild task, call it TaskA, that parses a file
I have written a custom server control which (pseudo-code) looks like public class MyCustomCtrl
I have written a class in python that implements __str__(self) but when I use
I have written a custom SessionStoreProvider class that inherits from the SessionStateStoreProviderBase. I have
We have written a custom windows service (VB.NET, .NET Framework 2.0) that takes a
I have written a custom credit card validation attribute that checks CardNumber property is
I have written one custom paremeterized jquery function for fadein and fade out. That
I have written a Custom Control that contains the following: [assembly: System.Web.UI.WebResource(InSysControls.AssignmentLists.AssignmentLists.js, text/javascript)] namespace
I have written a custom control that renders some graphics. The graphics itself is
I have written some custom R code that wraps a third-party binary. One of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.