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

Resource file again

P: n/a
I added a resource file into my project, to store the caption of buttons and
labels..
How do I make use of this resource file to dynamically assign to the buttons
and labels ?
Jul 5 '06 #1
Share this Question
Share on Google+
11 Replies


P: n/a
Alan,

What type of application is it - win or web?
--
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
>I added a resource file into my project, to store the caption of buttons
and labels..
How do I make use of this resource file to dynamically assign to the
buttons and labels ?

Jul 5 '06 #2

P: n/a
It is a Windows application.
What I want is to dynamically store the string to the form's label and
buttons'caption.

This is useful if we want to internationalize the application with other
language.

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:O9**************@TK2MSFTNGP05.phx.gbl...
Alan,

What type of application is it - win or web?
--
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
>>I added a resource file into my project, to store the caption of buttons
and labels..
How do I make use of this resource file to dynamically assign to the
buttons and labels ?


Jul 6 '06 #3

P: n/a
Alan,

The easiest would be to turn on the localization for the form. Just set the
form's Localizable property to *true*. Once you do this all the form and
form's controls properties such as Text, Size, Location, etc will go to a
resource file and the designer will generate the code to load them from
there. If you want to use your own resource file I'm afraid you need to read
the values and set the controls by yourself.

Anoither solution would be to use the application settings for storing the
values. In the designer select a control and then from the property window
expand the "Application Settings" node, which is the first on the top. You
can choose any control property form the PropertyBinding collcection and you
can also choose whether the property should go in the user or global
(application) settings.
--
HTH
Stoitcho Goutsev (100)
"Alan T" <al*************@yahoo.com.auwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
It is a Windows application.
What I want is to dynamically store the string to the form's label and
buttons'caption.

This is useful if we want to internationalize the application with other
language.

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:O9**************@TK2MSFTNGP05.phx.gbl...
>Alan,

What type of application is it - win or web?
--
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
>>>I added a resource file into my project, to store the caption of buttons
and labels..
How do I make use of this resource file to dynamically assign to the
buttons and labels ?



Jul 6 '06 #4

P: n/a
Hi,

Is what I did is correct ?

Right click the project
Add New Item
Choose 'Settings File'
Define the entries in the file

Then -
"In the designer select a control and then from the property window
expand the "Application Settings" node, which is the first on the top. You
can choose any control property form the PropertyBinding collcection and
you
can also choose whether the property should go in the user or global "

What will be the differences between 'user' and 'application' ?
"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:ur****************@TK2MSFTNGP04.phx.gbl...
Alan,

The easiest would be to turn on the localization for the form. Just set
the form's Localizable property to *true*. Once you do this all the form
and form's controls properties such as Text, Size, Location, etc will go
to a resource file and the designer will generate the code to load them
from there. If you want to use your own resource file I'm afraid you need
to read the values and set the controls by yourself.

Anoither solution would be to use the application settings for storing the
values. In the designer select a control and then from the property window
expand the "Application Settings" node, which is the first on the top. You
can choose any control property form the PropertyBinding collcection and
you can also choose whether the property should go in the user or global ,
(application) settings.
--
HTH
Stoitcho Goutsev (100)
"Alan T" <al*************@yahoo.com.auwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>It is a Windows application.
What I want is to dynamically store the string to the form's label and
buttons'caption.

This is useful if we want to internationalize the application with other
language.

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:O9**************@TK2MSFTNGP05.phx.gbl...
>>Alan,

What type of application is it - win or web?
--
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
I added a resource file into my project, to store the caption of buttons
and labels..
How do I make use of this resource file to dynamically assign to the
buttons and labels ?



Jul 7 '06 #5

P: n/a
Alan,
All settings in the application scope apply for all users. The settings in
the user scope are per user, thus the proeprty values can be different
depending on who runs the applciation.
--
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl...
Hi,

Is what I did is correct ?

Right click the project
Add New Item
Choose 'Settings File'
Define the entries in the file

Then -
"In the designer select a control and then from the property window
expand the "Application Settings" node, which is the first on the top. You
can choose any control property form the PropertyBinding collcection and
you
can also choose whether the property should go in the user or global "

What will be the differences between 'user' and 'application' ?
"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:ur****************@TK2MSFTNGP04.phx.gbl...
>Alan,

The easiest would be to turn on the localization for the form. Just set
the form's Localizable property to *true*. Once you do this all the form
and form's controls properties such as Text, Size, Location, etc will go
to a resource file and the designer will generate the code to load them
from there. If you want to use your own resource file I'm afraid you need
to read the values and set the controls by yourself.

Anoither solution would be to use the application settings for storing
the values. In the designer select a control and then from the property
window expand the "Application Settings" node, which is the first on the
top. You can choose any control property form the PropertyBinding
collcection and you can also choose whether the property should go in the
user or global ,

>(application) settings.
--
HTH
Stoitcho Goutsev (100)
"Alan T" <al*************@yahoo.com.auwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>>It is a Windows application.
What I want is to dynamically store the string to the form's label and
buttons'caption.

This is useful if we want to internationalize the application with other
language.

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:O9**************@TK2MSFTNGP05.phx.gbl...
Alan,

What type of application is it - win or web?
--
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
>I added a resource file into my project, to store the caption of
>buttons and labels..
How do I make use of this resource file to dynamically assign to the
buttons and labels ?
>




Jul 7 '06 #6

P: n/a
So I think I should use the 'Application'.

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
Alan,
All settings in the application scope apply for all users. The settings in
the user scope are per user, thus the proeprty values can be different
depending on who runs the applciation.
--
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl...
>Hi,

Is what I did is correct ?

Right click the project
Add New Item
Choose 'Settings File'
Define the entries in the file

Then -
"In the designer select a control and then from the property window
expand the "Application Settings" node, which is the first on the top.
You
can choose any control property form the PropertyBinding collcection and
you
can also choose whether the property should go in the user or global "

What will be the differences between 'user' and 'application' ?
"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:ur****************@TK2MSFTNGP04.phx.gbl...
>>Alan,

The easiest would be to turn on the localization for the form. Just set
the form's Localizable property to *true*. Once you do this all the form
and form's controls properties such as Text, Size, Location, etc will go
to a resource file and the designer will generate the code to load them
from there. If you want to use your own resource file I'm afraid you
need to read the values and set the controls by yourself.

Anoither solution would be to use the application settings for storing
the values. In the designer select a control and then from the property
window expand the "Application Settings" node, which is the first on the
top. You can choose any control property form the PropertyBinding
collcection and you can also choose whether the property should go in
the user or global ,

>>(application) settings.
--
HTH
Stoitcho Goutsev (100)
"Alan T" <al*************@yahoo.com.auwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl.. .
It is a Windows application.
What I want is to dynamically store the string to the form's label and
buttons'caption.

This is useful if we want to internationalize the application with
other language.

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:O9**************@TK2MSFTNGP05.phx.gbl...
Alan,
>
What type of application is it - win or web?
>
>
--
Stoitcho Goutsev (100)
>
"Alan T" <al*************@yahoo.com.auwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl.. .
>>I added a resource file into my project, to store the caption of
>>buttons and labels..
>How do I make use of this resource file to dynamically assign to the
>buttons and labels ?
>>
>
>




Jul 9 '06 #7

P: n/a
Hi,

In addition, is there really a way, I mean using the resource file to
configure the display caption of labels, buttons or treeview nodes text,
listview column text.
Is resource file's purpose for that ?

"Alan T" <al*************@yahoo.com.auwrote in message
news:uS**************@TK2MSFTNGP04.phx.gbl...
So I think I should use the 'Application'.

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
>Alan,
All settings in the application scope apply for all users. The settings
in the user scope are per user, thus the proeprty values can be different
depending on who runs the applciation.
--
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl...
>>Hi,

Is what I did is correct ?

Right click the project
Add New Item
Choose 'Settings File'
Define the entries in the file

Then -
"In the designer select a control and then from the property window
expand the "Application Settings" node, which is the first on the top.
You
can choose any control property form the PropertyBinding collcection and
you
can also choose whether the property should go in the user or global "

What will be the differences between 'user' and 'application' ?
"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:ur****************@TK2MSFTNGP04.phx.gbl.. .
Alan,

The easiest would be to turn on the localization for the form. Just set
the form's Localizable property to *true*. Once you do this all the
form and form's controls properties such as Text, Size, Location, etc
will go to a resource file and the designer will generate the code to
load them from there. If you want to use your own resource file I'm
afraid you need to read the values and set the controls by yourself.

Anoither solution would be to use the application settings for storing
the values. In the designer select a control and then from the property
window expand the "Application Settings" node, which is the first on
the top. You can choose any control property form the PropertyBinding
collcection and you can also choose whether the property should go in
the user or global ,
(application) settings.
--
HTH
Stoitcho Goutsev (100)
"Alan T" <al*************@yahoo.com.auwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl. ..
It is a Windows application.
What I want is to dynamically store the string to the form's label and
buttons'caption.
>
This is useful if we want to internationalize the application with
other language.
>
"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:O9**************@TK2MSFTNGP05.phx.gbl.. .
>Alan,
>>
>What type of application is it - win or web?
>>
>>
>--
>Stoitcho Goutsev (100)
>>
>"Alan T" <al*************@yahoo.com.auwrote in message
>news:u7**************@TK2MSFTNGP03.phx.gbl. ..
>>>I added a resource file into my project, to store the caption of
>>>buttons and labels..
>>How do I make use of this resource file to dynamically assign to the
>>buttons and labels ?
>>>
>>
>>
>
>




Jul 16 '06 #8

P: n/a
Yes, this is the place for that and as I said for WinForms it works
atomatically when localization is turned on. VS will save to resource and
generate a code for reading the values from there for any property
attributed with LocalizableAttribute.
--
HTH
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:uZ**************@TK2MSFTNGP04.phx.gbl...
Hi,

In addition, is there really a way, I mean using the resource file to
configure the display caption of labels, buttons or treeview nodes text,
listview column text.
Is resource file's purpose for that ?

"Alan T" <al*************@yahoo.com.auwrote in message
news:uS**************@TK2MSFTNGP04.phx.gbl...
>So I think I should use the 'Application'.

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
>>Alan,
All settings in the application scope apply for all users. The settings
in the user scope are per user, thus the proeprty values can be
different depending on who runs the applciation.
--
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl...
Hi,

Is what I did is correct ?

Right click the project
Add New Item
Choose 'Settings File'
Define the entries in the file

Then -
"In the designer select a control and then from the property window
expand the "Application Settings" node, which is the first on the top.
You
can choose any control property form the PropertyBinding collcection
and you
can also choose whether the property should go in the user or global "

What will be the differences between 'user' and 'application' ?
"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:ur****************@TK2MSFTNGP04.phx.gbl. ..
Alan,
>
The easiest would be to turn on the localization for the form. Just
set the form's Localizable property to *true*. Once you do this all
the form and form's controls properties such as Text, Size, Location,
etc will go to a resource file and the designer will generate the code
to load them from there. If you want to use your own resource file I'm
afraid you need to read the values and set the controls by yourself.
>
Anoither solution would be to use the application settings for storing
the values. In the designer select a control and then from the
property window expand the "Application Settings" node, which is the
first on the top. You can choose any control property form the
PropertyBinding collcection and you can also choose whether the
property should go in the user or global ,
(application) settings.
>
>
--
HTH
Stoitcho Goutsev (100)
>
>
"Alan T" <al*************@yahoo.com.auwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl.. .
>It is a Windows application.
>What I want is to dynamically store the string to the form's label
>and buttons'caption.
>>
>This is useful if we want to internationalize the application with
>other language.
>>
>"Stoitcho Goutsev (100)" <10*@100.comwrote in message
>news:O9**************@TK2MSFTNGP05.phx.gbl. ..
>>Alan,
>>>
>>What type of application is it - win or web?
>>>
>>>
>>--
>>Stoitcho Goutsev (100)
>>>
>>"Alan T" <al*************@yahoo.com.auwrote in message
>>news:u7**************@TK2MSFTNGP03.phx.gbl.. .
>>>>I added a resource file into my project, to store the caption of
>>>>buttons and labels..
>>>How do I make use of this resource file to dynamically assign to
>>>the buttons and labels ?
>>>>
>>>
>>>
>>
>>
>
>




Jul 17 '06 #9

P: n/a
How do I read the resource file of a Windows Form? Is that with
extension.resx ?

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:eI****************@TK2MSFTNGP05.phx.gbl...
Yes, this is the place for that and as I said for WinForms it works
atomatically when localization is turned on. VS will save to resource and
generate a code for reading the values from there for any property
attributed with LocalizableAttribute.
--
HTH
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:uZ**************@TK2MSFTNGP04.phx.gbl...
>Hi,

In addition, is there really a way, I mean using the resource file to
configure the display caption of labels, buttons or treeview nodes text,
listview column text.
Is resource file's purpose for that ?

"Alan T" <al*************@yahoo.com.auwrote in message
news:uS**************@TK2MSFTNGP04.phx.gbl...
>>So I think I should use the 'Application'.

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
Alan,
All settings in the application scope apply for all users. The settings
in the user scope are per user, thus the proeprty values can be
different depending on who runs the applciation.
--
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl...
Hi,
>
Is what I did is correct ?
>
Right click the project
Add New Item
Choose 'Settings File'
Define the entries in the file
>
Then -
"In the designer select a control and then from the property window
expand the "Application Settings" node, which is the first on the top.
You
can choose any control property form the PropertyBinding collcection
and you
can also choose whether the property should go in the user or global "
>
What will be the differences between 'user' and 'application' ?
>
>
"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:ur****************@TK2MSFTNGP04.phx.gbl.. .
>Alan,
>>
>The easiest would be to turn on the localization for the form. Just
>set the form's Localizable property to *true*. Once you do this all
>the form and form's controls properties such as Text, Size, Location,
>etc will go to a resource file and the designer will generate the
>code to load them from there. If you want to use your own resource
>file I'm afraid you need to read the values and set the controls by
>yourself.
>>
>Anoither solution would be to use the application settings for
>storing the values. In the designer select a control and then from
>the property window expand the "Application Settings" node, which is
>the first on the top. You can choose any control property form the
>PropertyBinding collcection and you can also choose whether the
>property should go in the user or global ,
>
>
>(application) settings.
>>
>>
>--
>HTH
>Stoitcho Goutsev (100)
>>
>>
>"Alan T" <al*************@yahoo.com.auwrote in message
>news:%2****************@TK2MSFTNGP05.phx.gbl. ..
>>It is a Windows application.
>>What I want is to dynamically store the string to the form's label
>>and buttons'caption.
>>>
>>This is useful if we want to internationalize the application with
>>other language.
>>>
>>"Stoitcho Goutsev (100)" <10*@100.comwrote in message
>>news:O9**************@TK2MSFTNGP05.phx.gbl.. .
>>>Alan,
>>>>
>>>What type of application is it - win or web?
>>>>
>>>>
>>>--
>>>Stoitcho Goutsev (100)
>>>>
>>>"Alan T" <al*************@yahoo.com.auwrote in message
>>>news:u7**************@TK2MSFTNGP03.phx.gbl. ..
>>>>>I added a resource file into my project, to store the caption of
>>>>>buttons and labels..
>>>>How do I make use of this resource file to dynamically assign to
>>>>the buttons and labels ?
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>




Jul 18 '06 #10

P: n/a
Alan,

There might be as many resources as you want with one application. the
resources can be stored in on the disk as resx files, embeded in the an
assembly, in satellite assembly, etc. I addtion any files that you want can
be added as a embedded resource to your assembly.
The resource file the windows forms form or user control uses to store
localized proeprty values is hidden by default. In order to see it click on
the "Show All Files" button from the solution explorer toolbar. Then you can
see [+] sign next to the form or user control node on the tree. Expand the
node and you'll see the resx file.

In order to read resource at runtime you can use the ResourceManager class
or alternatively you can use Assembly.GetManifestResourceStream method.

My suggestion is to turn on the localization on some test form and look at
the InitializeComponent method the code that VS generates.
--
HTH
Stoitcho Goutsev (100)
"Alan T" <al*************@yahoo.com.auwrote in message
news:eN**************@TK2MSFTNGP05.phx.gbl...
How do I read the resource file of a Windows Form? Is that with
extension.resx ?

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:eI****************@TK2MSFTNGP05.phx.gbl...
>Yes, this is the place for that and as I said for WinForms it works
atomatically when localization is turned on. VS will save to resource and
generate a code for reading the values from there for any property
attributed with LocalizableAttribute.
--
HTH
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:uZ**************@TK2MSFTNGP04.phx.gbl...
>>Hi,

In addition, is there really a way, I mean using the resource file to
configure the display caption of labels, buttons or treeview nodes text,
listview column text.
Is resource file's purpose for that ?

"Alan T" <al*************@yahoo.com.auwrote in message
news:uS**************@TK2MSFTNGP04.phx.gbl...
So I think I should use the 'Application'.

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
Alan,
All settings in the application scope apply for all users. The
settings in the user scope are per user, thus the proeprty values can
be different depending on who runs the applciation.
>
>
--
Stoitcho Goutsev (100)
>
"Alan T" <al*************@yahoo.com.auwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl.. .
>Hi,
>>
>Is what I did is correct ?
>>
>Right click the project
>Add New Item
>Choose 'Settings File'
>Define the entries in the file
>>
>Then -
>"In the designer select a control and then from the property window
>expand the "Application Settings" node, which is the first on the
>top. You
>can choose any control property form the PropertyBinding collcection
>and you
>can also choose whether the property should go in the user or global
>"
>>
>What will be the differences between 'user' and 'application' ?
>>
>>
>"Stoitcho Goutsev (100)" <10*@100.comwrote in message
>news:ur****************@TK2MSFTNGP04.phx.gbl. ..
>>Alan,
>>>
>>The easiest would be to turn on the localization for the form. Just
>>set the form's Localizable property to *true*. Once you do this all
>>the form and form's controls properties such as Text, Size,
>>Location, etc will go to a resource file and the designer will
>>generate the code to load them from there. If you want to use your
>>own resource file I'm afraid you need to read the values and set the
>>controls by yourself.
>>>
>>Anoither solution would be to use the application settings for
>>storing the values. In the designer select a control and then from
>>the property window expand the "Application Settings" node, which is
>>the first on the top. You can choose any control property form the
>>PropertyBinding collcection and you can also choose whether the
>>property should go in the user or global ,
>>
>>
>>(application) settings.
>>>
>>>
>>--
>>HTH
>>Stoitcho Goutsev (100)
>>>
>>>
>>"Alan T" <al*************@yahoo.com.auwrote in message
>>news:%2****************@TK2MSFTNGP05.phx.gbl ...
>>>It is a Windows application.
>>>What I want is to dynamically store the string to the form's label
>>>and buttons'caption.
>>>>
>>>This is useful if we want to internationalize the application with
>>>other language.
>>>>
>>>"Stoitcho Goutsev (100)" <10*@100.comwrote in message
>>>news:O9**************@TK2MSFTNGP05.phx.gbl. ..
>>>>Alan,
>>>>>
>>>>What type of application is it - win or web?
>>>>>
>>>>>
>>>>--
>>>>Stoitcho Goutsev (100)
>>>>>
>>>>"Alan T" <al*************@yahoo.com.auwrote in message
>>>>news:u7**************@TK2MSFTNGP03.phx.gbl ...
>>>>>>I added a resource file into my project, to store the caption of
>>>>>>buttons and labels..
>>>>>How do I make use of this resource file to dynamically assign to
>>>>>the buttons and labels ?
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>




Jul 18 '06 #11

P: n/a
Back to the settings file:
What will be the effect between using the "user" and "application" scope?

eg.
I define that as "user" scope and my user runs my application.

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:Oa**************@TK2MSFTNGP05.phx.gbl...
Alan,

There might be as many resources as you want with one application. the
resources can be stored in on the disk as resx files, embeded in the an
assembly, in satellite assembly, etc. I addtion any files that you want
can be added as a embedded resource to your assembly.
The resource file the windows forms form or user control uses to store
localized proeprty values is hidden by default. In order to see it click
on the "Show All Files" button from the solution explorer toolbar. Then
you can see [+] sign next to the form or user control node on the tree.
Expand the node and you'll see the resx file.

In order to read resource at runtime you can use the ResourceManager class
or alternatively you can use Assembly.GetManifestResourceStream method.

My suggestion is to turn on the localization on some test form and look at
the InitializeComponent method the code that VS generates.
--
HTH
Stoitcho Goutsev (100)
"Alan T" <al*************@yahoo.com.auwrote in message
news:eN**************@TK2MSFTNGP05.phx.gbl...
>How do I read the resource file of a Windows Form? Is that with
extension.resx ?

"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:eI****************@TK2MSFTNGP05.phx.gbl...
>>Yes, this is the place for that and as I said for WinForms it works
atomatically when localization is turned on. VS will save to resource
and generate a code for reading the values from there for any property
attributed with LocalizableAttribute.
--
HTH
Stoitcho Goutsev (100)

"Alan T" <al*************@yahoo.com.auwrote in message
news:uZ**************@TK2MSFTNGP04.phx.gbl...
Hi,

In addition, is there really a way, I mean using the resource file to
configure the display caption of labels, buttons or treeview nodes
text, listview column text.
Is resource file's purpose for that ?

"Alan T" <al*************@yahoo.com.auwrote in message
news:uS**************@TK2MSFTNGP04.phx.gbl...
So I think I should use the 'Application'.
>
"Stoitcho Goutsev (100)" <10*@100.comwrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl.. .
>Alan,
>All settings in the application scope apply for all users. The
>settings in the user scope are per user, thus the proeprty values can
>be different depending on who runs the applciation.
>>
>>
>--
>Stoitcho Goutsev (100)
>>
>"Alan T" <al*************@yahoo.com.auwrote in message
>news:OG**************@TK2MSFTNGP04.phx.gbl. ..
>>Hi,
>>>
>>Is what I did is correct ?
>>>
>>Right click the project
>>Add New Item
>>Choose 'Settings File'
>>Define the entries in the file
>>>
>>Then -
>>"In the designer select a control and then from the property window
>>expand the "Application Settings" node, which is the first on the
>>top. You
>>can choose any control property form the PropertyBinding collcection
>>and you
>>can also choose whether the property should go in the user or global
>>"
>>>
>>What will be the differences between 'user' and 'application' ?
>>>
>>>
>>"Stoitcho Goutsev (100)" <10*@100.comwrote in message
>>news:ur****************@TK2MSFTNGP04.phx.gbl ...
>>>Alan,
>>>>
>>>The easiest would be to turn on the localization for the form. Just
>>>set the form's Localizable property to *true*. Once you do this all
>>>the form and form's controls properties such as Text, Size,
>>>Location, etc will go to a resource file and the designer will
>>>generate the code to load them from there. If you want to use your
>>>own resource file I'm afraid you need to read the values and set
>>>the controls by yourself.
>>>>
>>>Anoither solution would be to use the application settings for
>>>storing the values. In the designer select a control and then from
>>>the property window expand the "Application Settings" node, which
>>>is the first on the top. You can choose any control property form
>>>the PropertyBinding collcection and you can also choose whether the
>>>property should go in the user or global ,
>>>
>>>
>>>(application) settings.
>>>>
>>>>
>>>--
>>>HTH
>>>Stoitcho Goutsev (100)
>>>>
>>>>
>>>"Alan T" <al*************@yahoo.com.auwrote in message
>>>news:%2****************@TK2MSFTNGP05.phx.gb l...
>>>>It is a Windows application.
>>>>What I want is to dynamically store the string to the form's label
>>>>and buttons'caption.
>>>>>
>>>>This is useful if we want to internationalize the application with
>>>>other language.
>>>>>
>>>>"Stoitcho Goutsev (100)" <10*@100.comwrote in message
>>>>news:O9**************@TK2MSFTNGP05.phx.gbl ...
>>>>>Alan,
>>>>>>
>>>>>What type of application is it - win or web?
>>>>>>
>>>>>>
>>>>>--
>>>>>Stoitcho Goutsev (100)
>>>>>>
>>>>>"Alan T" <al*************@yahoo.com.auwrote in message
>>>>>news:u7**************@TK2MSFTNGP03.phx.gb l...
>>>>>>>I added a resource file into my project, to store the caption of
>>>>>>>buttons and labels..
>>>>>>How do I make use of this resource file to dynamically assign to
>>>>>>the buttons and labels ?
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>




Jul 20 '06 #12

This discussion thread is closed

Replies have been disabled for this discussion.