|
Hi!
I've localized my application to languages like English_US,Chinese_Simplified,Chinese_Traditional,Thai,Greek,Spanish,Japanese.
I've added these languages to a list box. I've get currently selected from the list and uses it to get the culture info. I've also set different font's for the form according to the list selection(Why because languages like Chines,Japanese and Korean were not displayed with out the corresponding font). Here's the code:
switch(listIndex)
{
case 0:
cultureCode = "en-US";
this->Font = System::Drawing::Font(L"Microsoft Sans Serif",8);
break;
case 1:
cultureCode = "zh-CN";
this->Font = System::Drawing::Font(L"Simsun",8);
break;
case 2:
cultureCode = "fr-FR"
this->Font = System::Drawing::Font(L"Verdana",8);
break;
default:
}
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("cultureCode");
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
My problem is:
(i) size of my form shrinks when I select any language other than English. This doesn't happen always. If I set the font through code as above, the size of the form shrinks. If I didn't set the font through code, Chinese,Japanese and Korean languages can't be displayed. What to do to display these languages as well as to keep the form size constant?
(ii) Which font is required to display Korean language?
modified on Thursday, March 31, 2011 1:19 PM
|
|
|
|
|
A Windows form has the properties AutoSize and AutoSizeMode . You can set AutoSize to false to prevent any size changes, or AutoSizeMode to GrowOnly to allow for a growing form.
|
|
|
|
|
Hi!
Thanks for the reply. Setting the font is not enough to display Chinese Text over Title Bar of the form(Caption of the Form). Every language Text is displayed properly else where except the Caption of the Form. What to do to dispaly Chinese Text over the caption of the form?
|
|
|
|
|
I've noticed one problem with the code snippet.
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("cultureCode");
Looks like it should be
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(cultureCode);
Also the way I've handled globalisation is by using resource files and letting the system's culture determine which resource file to use. You might want to Read these MSDN articles
"You get that on the big jobs."
|
|
|
|
|
Hi!
I've added an ShockwaveFlashObject inside my Windows Form. I've used the following code to run an SWF file:
this->axShockwaveFlash1->BringToFront();
this->axShockwaveFlash1->Movie::set(gcnew System::String(StringToWString(spath).c_str()));
this->axShockwaveFlash1->Play();
This code is inside the form load event. But when I run the application, the movie is not playing. What to do to run the swf file from Windows forms?
|
|
|
|
|
I would suspect it doesn't play because the form hasn't been shown yet and may not have a window handle.
Put a button on the form and move the play code to the Click event of that button. Try that and see what happens.
|
|
|
|
|
Now also the same thing. What to do to run the SWF file? I've also added a split container to the form. Is that may be cause for this problem?
|
|
|
|
|
Not unless you put the player behind the panels of the player instead of IN one of the panels.
|
|
|
|
|
Hi!
Can you tell me if any thing else has to be done in the coding part to run a SWF file from windows forms?
|
|
|
|
|
Nope, you've already done it all.
|
|
|
|
|
Works OK on my laptop system.
I must get a clever new signature for 2011.
|
|
|
|
|
1. Yes and Yes.
2. I have no Tweak-UI or similar, this is just a standard Windows 7 system.
I must get a clever new signature for 2011.
|
|
|
|
|
I have a winform application that opens other winform objects I need to limit these new winform objects to one instance. I understand mutexes but don't know what to override in the winform object to limit it to a single instance.
|
|
|
|
|
if it is all about forms in a single application, why can't you keep a count and organize things the way you want? I don't see the need for mutexes here.
if it is about limiting the number of instances of a specific app, then that is where a mutex would come in. Search this site for "single instance application", you will find lots of articles (language doesn't matter, the principles are the same everywhere), some are good.
BTW: none of them really limit the apps to one, all they do is have the extra instances close as soon as possible, however they do open first...
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Your right the mutex is over kill what I need to know is which method to override in order to close the child winform objects. I'm new to the dot net platform and still learning.
|
|
|
|
|
I still sense some confusion. You can close a modeless form (that is one shown through Show() as opposed to a modal dialog, which gets shown by calling ShowDialog() ) by calling its Close() method, no need to override anything.
However, if you want to limit the number of open windows, why not just NOT open them, rather than closing them once you decided they are too many?
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thanks for your help I didn't realize you could make a winform modal.
|
|
|
|
|
|
Hello, I am working with Visual Studio 2010 and a Windows Form application, because I want to include a SQL Databse .mdf file as resource for that application in order to keep the data inside the application, I Try to include a new element and I choose a database linked to Service (*.mdf datafile) but I allways receive an error message in which it says that for that action is needed to install first SQL Server 2005 Express or SQL Server 2008 Express and it give an Internet address for downloading.
The situation is that SQL Server 2008 Express is just installed, and I can create the same named database from SQL Server Management Studio o Visual Studio Server Explorer without any problem, so why it's not posible to aggregate as new element in the Solution Explorer.
Best Regards
|
|
|
|
|
It's not clear what your problem is because you say a couple things that are contradictory.
I'll just say that you cannot use a database that is stored in your app's resources. It must be a seperate file in the file system in order for SQL Server to use it.
|
|
|
|
|
Hi!
I've two Forms. In the first form I've added three Radio Buttons. My second form (i.e class Form2) has to know which radio Button was selected at a particular instance. I'm using Windows forms C++/CLI. How to do this?
|
|
|
|
|
Expose a property on the first form that gives you the index of the selected radiobutton. From the second form, read the property on the given particular instance.
I are Troll
|
|
|
|
|
I am using google to try find a form generator that will take a C# or C++/CLI class as its input with no success.
Any Recommendations?
Ger
|
|
|
|
|
Are you trying to convert a class to a Windows Form? Why can't you just use the classes and there public methods and properties in a form?
|
|
|
|
|
Thats exactly what I want to do - but there are 100 elements. How do I make it autogenerate?
Ger
|
|
|
|