Embed FolderBrowserDialog into Form [duplicate] - c#

This question already has answers here:
Embed a File Chooser in a UserControl / Form
(2 answers)
Closed 4 years ago.
How can I embed the FolderBrowserDialog into my "form1"?
I don't want a popup dialog, how can I achieve this?

You need to implement your own coding for doing so. It is rather easy, you can use some TreeViews and ListViews and use File Path and other stuff from System.IO class.

It is not possible to embed the FolderBrowserDialog in your own form, but you can use 3rd party controls like Shell MegaPack to do this.
DISCLAIMER: I work for LogicNP Software, the developer of Shell MegaPack.

Related

How to make file to be opened by my app? [duplicate]

This question already has answers here:
Where does Windows store its "Open With" settings?
(3 answers)
Closed 9 years ago.
I have a little bit confusing problem. I'm not a beginner but I don't know how to do it..
For example I've written a program like notepad from which you can open files, save and etc. But when I set any custom format like ".blabla" to be opened by my app it is not working, so how can I make it to be opened by my app?
It is in WinForms
You need an entry in the registry for custom file extensions. You can try inserting a key in the registry as follows:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\

C# launch power options [duplicate]

This question already has answers here:
How can run functions of powercfg by C# code?
(3 answers)
Closed 9 years ago.
From my C# program I want to open the power options from the control panel in Windows.
However I can't seem to find out how to do that, I tried making a shortcut and see where it goes but it is referring to the control panel.
Does anyone have an idea how to do that or where the exe is located to launch?
Try the following:
System.Diagnostics.Process.Start("powercfg.cpl");

How to create a button with 'Cancel' text which is language dependant? [duplicate]

This question already has answers here:
Can you access standard Windows strings like 'Cancel'?
(4 answers)
Is there a repository for localized common text in WinForms?
(2 answers)
Closed 9 years ago.
I would like to add to the form an universal 'Cancel' button. By universal I mean that on a system with different than English locales it will display localized 'Cancel' string. How to achieve this?
You need to use the localization support provided by .NET and Visual Studio. See for example a walkthrough here: Localizing Windows Forms.

C# class similar to Java Desktop class [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Open file with associated application
I want to open a file in it respective application, e.g. open function of windows.
Same thing can be done in java with the help of Desktop class where you pass the file name and the respective file is opened.
But no idea how to do in C#.
System.Diagnostics.Process.Start("filename.doc");

Using FolderBrowserDialog in WPF application [duplicate]

This question already has answers here:
Open directory dialog
(16 answers)
Closed 9 years ago.
I have a WPF application that I need to have users access directories in. I have searched to the end of the world on how to integrate windows forms into WPF and have found all kinds of information on how to integrate form controls into my xaml, however, integrating a FolderBrowserDialog.
I am veteran programmer, but very new to .net (2nd day in fact), and I believe I can not find good information on immplementing this simply because I can not determine what the name/type is for a FolderBrowserDialog.
Oh, and I am using c# and Visual Studio 2008
You need to add a reference to System.Windows.Forms.dll, then use the System.Windows.Forms.FolderBrowserDialog class.
Adding using WinForms = System.Windows.Forms; will be helpful.
If I'm not mistaken you're looking for the FolderBrowserDialog (hence the naming):
var dialog = new System.Windows.Forms.FolderBrowserDialog();
System.Windows.Forms.DialogResult result = dialog.ShowDialog();
Also see this SO thread: Open directory dialog

Categories