Introduction
This is a tip to show different languages to common dialogs of Windows.
Background
Why did I post this? It is because I failed to get results even after Googling it for three hours, most of the responses were "No, you cannot do it." But, there must be a way.
Using the Code
First, the problem, try the following code anywhere inside a Winform app:
OpenFileDialog dlg = new OpenFileDialog();
dlg.ShowDialog();
You will see, the file opens a dialog popup with your OS languages. You could not modify it with properties of OpenFileDialog
or CurrentUICulture
. See this link.
The solution is easy, and I don't have much experience with Localization projects. I may update this in future if I work more on it.
[DllImport("Kernel32.dll", CharSet = CharSet.Auto)]
static extern System.UInt16 SetThreadUILanguage(System.UInt16 LangId);
SetThreadUILanguage(2052);
Refer more from MSDN - SetThreadUILanguages
.
Points of Interest
Nothing, just keep searching, pop up questions from different points, you may get more.
History
- 3rd April, 2017: Initial version