Open file dialog box in c#


Open file dialog box

We can make an OpenFileDialog control utilizing a Forms fashioner at configuration time or utilizing the Open file dialog box class in code at run-time (otherwise called powerfully). Not at all like different Windows Forms controls, an OpenFileDialog doesn’t have and not need visual properties like others. The main motivation behind OpenFileDialog to show accessible hues, make custom hues, and select a shading from these hues. When shading is chosen, we need that shading in our code so we can apply it to different controls.

Once more, you can make an OpenFileDialog at configuration time however it is simpler to make an OpenFileDialog at run-time.

Open file dialog box

Configuration time

To make an OpenFileDialog control at configuration time, you just simplified an OpenFileDialog control from Toolbox to a Form in Visual Studio. After you intuitive an OpenFileDialog on a Form, the OpenFileDialog looks

The FileName property can be set before indicating the exchange box. This causes the exchange box to at first presentation the given filename. By and large, your applications should set the InitialDirectory, Filter, and FilterIndex properties before calling ShowDialog.

The accompanying C# program welcomes an OpenFile Dialog Box and recovers the chose filename to a string.

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories

%d bloggers like this: