By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,148 Members | 765 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,148 IT Pros & Developers. It's quick & easy.

Change output language runtime forms

P: n/a
Gwl
I'm writing an application in which the user can change the default
ouput language while the program is running. I have no problem to do it
when there is only a form opened, but if I have a situation like a
second form opened I don't know how I could change the otuput language
in the main form and in all the background forms. Any advice?

Thanks, G.

Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Gwl wrote:
I'm writing an application in which the user can change the default
ouput language while the program is running. I have no problem to do
it when there is only a form opened, but if I have a situation like a
second form opened I don't know how I could change the otuput language
in the main form and in all the background forms. Any advice?


You'll have to go through the original form and change the titles of the
control. I assume that this second form changes the CurrentUICulture on
the GUI thread. If this is the case then add a method to your main form
that the second form can call. Now look in the InitializeComonent and
copy the code that initializes the ResourceManager and copy any code
that uses the ResourceManager object.

When a form is created a ResourceManager is created, this searches for,
and loads a 'satellite assembly' which has the localised resource. The
code then calls the ResourceManager and asks for a particular item,
RsourceManager reads the item from the localised resource in the
satellite assembly and uses this to initialise controls on the form. You
just need to replicate this code.

Richard
--
http://www.grimes.demon.co.uk/workshops/fusionWS.htm
http://www.grimes.demon.co.uk/workshops/securityWS.htm
Nov 17 '05 #2

P: n/a
Gwl
Sorry if I reply so late.

My approch to write an application that can show otput message in
different languages is not the "standard" one. I don't use any of the
features related to the CurrentUICulture (even if I tried it). I have a
database of all the msgs that I write on the screen (and even of the
message on buttons etc.) and I use the information inside that database
for the output on the screen. The database is easy to modify, update
(eventually with new languages) and maintain and that was my first
concern.

As I told, my program change correctly the language of the main form
but if there are other form behind these are not updated. Any help?

Thanks, Gwl

Richard Grimes wrote:
Gwl wrote:
I'm writing an application in which the user can change the default
ouput language while the program is running. I have no problem to do
it when there is only a form opened, but if I have a situation like a
second form opened I don't know how I could change the otuput language
in the main form and in all the background forms. Any advice?


You'll have to go through the original form and change the titles of the
control. I assume that this second form changes the CurrentUICulture on
the GUI thread. If this is the case then add a method to your main form
that the second form can call. Now look in the InitializeComonent and
copy the code that initializes the ResourceManager and copy any code
that uses the ResourceManager object.

When a form is created a ResourceManager is created, this searches for,
and loads a 'satellite assembly' which has the localised resource. The
code then calls the ResourceManager and asks for a particular item,
RsourceManager reads the item from the localised resource in the
satellite assembly and uses this to initialise controls on the form. You
just need to replicate this code.

Richard
--
http://www.grimes.demon.co.uk/workshops/fusionWS.htm
http://www.grimes.demon.co.uk/workshops/securityWS.htm


Nov 24 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.