Click here to Skip to main content
15,891,204 members
Home / Discussions / C#
   

C#

 
GeneralCapture Winlogon.exe Events Pin
DFU2311-May-03 13:58
DFU2311-May-03 13:58 
GeneralRe: Capture Winlogon.exe Events Pin
cdehelean13-May-03 2:09
cdehelean13-May-03 2:09 
Generalmdichild forms Pin
Anonymous11-May-03 6:34
Anonymous11-May-03 6:34 
GeneralRe: mdichild forms Pin
Jon Newman11-May-03 7:44
Jon Newman11-May-03 7:44 
GeneralRegions/Search/String Table Pin
Kant11-May-03 6:11
Kant11-May-03 6:11 
GeneralRe: Regions/Search/String Table Pin
James T. Johnson11-May-03 7:10
James T. Johnson11-May-03 7:10 
GeneralRe: Regions/Search/String Table Pin
Kant11-May-03 7:51
Kant11-May-03 7:51 
GeneralRe: Regions/Search/String Table Pin
James T. Johnson11-May-03 8:24
James T. Johnson11-May-03 8:24 
Kant wrote:
How to add these kinda of strings in the .resx file?

The .resx file is just an XML file with a certain format so you can see the format other entries use, in my quick example I did to write that post I have a ton of schema stuff, plus some configuration stuff that the Resource* classes use to properly read the data then in the end:

<data name="theStringName">
	<value>The String Value</value>
</data>
Then you can read these out with:

System.Resources.ResourceManager resources = new
	System.Resources.ResourceManager(see below);
 
string myString = resources.GetString("theStringName");
The constructor to the System.Resources.ResourceManager relies on some naming information and an Assembly to search to find the resources. It appears that the naming follows that of Embedded Resources, so you may wish to reference my article concerning them[^] to see what you need to pass in.

If you look at the code that the WinForms designer generates you'll see it passes in typeof(MyForm), the ResourceManager then pulls all of the information it needs from the Type which is passed in. This works well for the designer, but probably won't for your own code (unless you write a wrapper class to handle all of this for you). In which case use a combination of the help topic for the ResourceManager class and my article to figure out how the name you pass in.

Also, don't forget to make the .resx file an embedded resource Smile | :)

James

"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation

GeneralRe: Regions/Search/String Table Pin
Kant11-May-03 14:02
Kant11-May-03 14:02 
General[Serializable()] Pin
Anonymous11-May-03 4:32
Anonymous11-May-03 4:32 
GeneralRe: [Serializable()] Pin
leppie11-May-03 4:56
leppie11-May-03 4:56 
GeneralRe: [Serializable()] Pin
Anonymous11-May-03 5:28
Anonymous11-May-03 5:28 
QuestionDataView override? Pin
Rocky Moore10-May-03 23:40
Rocky Moore10-May-03 23:40 
AnswerRe: DataView override? Pin
leppie11-May-03 4:36
leppie11-May-03 4:36 
GeneralRe: DataView override? Pin
Rocky Moore12-May-03 0:29
Rocky Moore12-May-03 0:29 
GeneralBest way to declare a protected set prop for read-only prop Pin
J. Dunlap10-May-03 19:10
J. Dunlap10-May-03 19:10 
GeneralRe: Best way to declare a protected set prop for read-only prop Pin
leppie11-May-03 4:28
leppie11-May-03 4:28 
GeneralRe: Best way to declare a protected set prop for read-only prop Pin
J. Dunlap11-May-03 8:27
J. Dunlap11-May-03 8:27 
GeneralWhere can I find the C# language API. Pin
KBeutler10-May-03 11:30
KBeutler10-May-03 11:30 
GeneralRe: Where can I find the C# language API. Pin
David Stone10-May-03 12:38
sitebuilderDavid Stone10-May-03 12:38 
GeneralHard disk number Pin
BoudewijnEctor10-May-03 9:33
BoudewijnEctor10-May-03 9:33 
GeneralRe: Hard disk number Pin
jhaga11-May-03 6:07
professionaljhaga11-May-03 6:07 
GeneralRe: Hard disk number Pin
BoudewijnEctor12-May-03 10:35
BoudewijnEctor12-May-03 10:35 
GeneralRe: Hard disk number Pin
Bo Hunter12-May-03 14:09
Bo Hunter12-May-03 14:09 
GeneralAccessing File Properties "Summary "Tab Info Pin
Grant11110-May-03 9:13
Grant11110-May-03 9:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.