473,618 Members | 3,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change output language runtime forms

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
2 3053
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 CurrentUICultur e 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 InitializeComon ent 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
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 CurrentUICultur e (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 CurrentUICultur e 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 InitializeComon ent 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2921
by: Bj?rn | last post by:
HY, my problem is the following: I want to give a very big application the ability, to change the language at runtime. It's written in Visual C++ 6.0. All language depending strings and so on, are already stored in different resource-dll's. The way, I understand it, there is a list of resources, which the application goes through, searching for strings. For example my string is in stringa.dll in english. But I want to have
13
6078
by: Andrew | last post by:
I use conditional compiler constants, set through the VBA IDE in Tools, <projectname> Properties, that I refer to throughout my code to control which code is used during development, and which during production. Usually, this only wraps code used to control quitting the whole app versus just shutting a form, but it can also control many other things. However, as part of the build before delivering an update, I have to remember to...
5
3023
by: chris | last post by:
Hello all - Preface: This isn't a C# Builder question but if you happen to have the answer to my primary problem, please feel free to chime in ;-) I'm using Borland's C# Builder (Personal) and it seems there isn't an Output window (where the Debug.WriteLine() info would go) like VS has. If there is, I can't find it. I would like to know if it is possible to write a class with the ability to call a console window that would display...
2
8524
by: Sanjeeva Reddy | last post by:
hai Anti Keskinen, i have used the following code MyListView->LargeImageList->ImageSize = gcnew System::Drawing::Size(100, 100); // Sets large image size to 100, 100 here i am getting error like "gcnew is undeclared error",how to deeclare 'gcnew" and when i am using in runtime to change the size of images in imagelist in listview control in .net(forms application) by chnging one trckbar(like tb1->Value),
1
4762
by: Leo | last post by:
I created a user control which is some text contained in a HtmlTable. I put this control into main form. I would like to have the ability to move this control around in the main form. I think one way to do this is to change the style of this control at runtime ("Left:xx px; Top:xx px"). Another way is to move the HtmlTable in the control (i.e. change the style of it). However I couldn't figure out how to let it work. At design time, I...
0
2484
by: zeng.hui.stephen | last post by:
I download the demo http://msdn.microsoft.com/msdnmag/issues/02/10/cuttingedge/. I inherite the demo, and write my code. I want to use Hook to monitor C++ Edit change. I use a C# form containing a Edit(textbox) and button to test at first. When I change text in Edit or press button to setText value, I want to monitor the change event. But the event code always return 0, why?
4
3765
by: Hans Kesting | last post by:
Can I change the language of an existing form on the fly? Say I have two radiobuttons: "dutch" and "english". When the user selects one, the form must switch to the selected language. Is that possible and how? When I set System.Threading.Thread.CurrentThread.CurrentUICulture, any new forms will use the new language. Existing forms keep their language.
0
952
by: Carlos Cruz | last post by:
Hi, I'm trying to make a multilanguage application. I manage to create the forms resource files for each language and to read them (rm.GetString("Label1.Text", pCultureInfo)), but I need to change all objects after changing pCultureInfo. Is it possible to change the forma language in code? Where? How? (I see that in designtime when I change the language, all objects are updated... I it might be possible to do it in runtime)
2
1401
by: itsenthil | last post by:
This is my UserControl(ascx) coding, it is not working plz help me to rectify the error.....what is wrong in that one..... <%@ Control Language="vb" AutoEventWireup="false" Codebehind="Usea.ascx.vb" Inherits="HIS.Usea" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %> <script language="javascript" type="text/javascript"> function output() { var xx = document.getElementsByName("cbtest").value; // var...
0
8212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8304
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6101
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5552
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4065
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.