|
Not translation, no, but localization and globalization, yes. Read Developing World-Ready Applications[^] in the .NET Framework SDK for detailed information. ResX files are actually better than string tables because you can store more than just strings. Even something as simple as string formatting is better in .NET because you can specify which arguments go where in a string, meaning that you can localize the format string but still specify the parameters in the same order for any language. See my article, Custom String Formatting in .NET[^], for a discussion about this.
If you're using Visual Studio .NET to develop your managed applications, developing world-ready applications could be much easier. Design your UI and all the text, the select the form and open the PropertyGrid (should already be open; otherwise, right-click and select "Properties"). Find the "Localizable" property and set it to "True", then find the "Language" property and set that to another language. You can then change your strings, control sizes and locations, and more.
A few things to keep in mind. The neutral language - the language in which you develop and that the primary assembly (the assembly with code) uses - should not be localized separately. This is also the fallback language if a satellite assembly cannot be found. This is covered in the documentation I linked first. To make your application run faster, you should put the following attribute in your AssemblyInfo.cs file (or anywhere, actually, but that source file is most common):
[assembly: System.Resources.NeutralResourcesLanguage("en-US")] Here, my neutral language would be "en-US" (English (U.S.)) because that's the language in which I developed the primary assembly. I could then switch to "German" (for an invariant locale, which means I'm just localizing the German language but not for a particular region) and change my UI. When you compile, several assemblies are produced. You must ship all to have your localized UI displayed correctly.
The localized UI is controlled by the Thread.CurrentUICulture . Windows will set the thread's LANGID (the CurrentUICulture) to the user's preferred (or the system's default) LANGID, but you can override that by setting Thread.CurrentUICulture before displaying your UI.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Please, help me
I have one problem. I don't know how to drawing ONLY one point on form.
Thanks
|
|
|
|
|
Does drawing a line from x,y to x,y+1 solve your problem?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
|
Hi
I have a functional web service. It's very simple - like adds two numbers. then when i want to use it in a c# application, i know i should add it as a web reference.. In all the examples i have seen, the Solution Explorer shows many other files under the new web reference. but when i add mine, it just shows the name of the reference. Is this a problem? Cuz i cant get the application to find the service when i try specify it with USING ... ?
Please help!
Thanks
|
|
|
|
|
Hi,
You can see all the files by taking the "Show All Files" option from the solution explorer. Then you can see the .WSDL , .DISCO files and all the other files.
If you want to access your service reference in the "using" statemen give
using XXXX.WebreferenceName;
where XXXX is the namespcace of the application to which you added the reference.
Guess this will help you.
Thanks and Regards
SGS
|
|
|
|
|
Hi, I'm trying to have interprocess communication between two programs. The first one is written in C++ (embedded for PocketPC) and the latter in C# and .NET CE (for PocketPC). I want to use memmory mapped files for IPC.
In the C++ side I use the following API:
CreateFileMapping()
CreateMutex()
MapViewOfFile()
...
What can I do from the C# side in order to communicate properly?
Thank you,
Themis
|
|
|
|
|
Hi All,
I am trying to build an application in VS.Net which uses Crystal Report 11 to build the rpt file. I have an XML and XSD file as my datasources. I want to view the report in PDF format. Now my source code looks like:
ReportDocument doc = new ReportDocument();
string fileName = Server.MapPath("MyReport.rpt");
doc.Load(fileName);
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("MyXML.xml"));
doc.SetDataSource(ds);
ExportOptions exportOpts = doc.ExportOptions;
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
exportOpts.DestinationOptions = new DiskFileDestinationOptions();
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
((DiskFileDestinationOptions)doc.ExportOptions.DestinationOptions).DiskFileName = Server.MapPath("MyPDF.pdf");
doc.Export();
But it gives me the error
"Query Engine Error: 'c:\inetpub\wwwroot\MyWebsite\MyReport.rpt'"
I tried out all the forums but could not find any solution. Someone told me that it is due to xsd file error. But in Crystal Report it is running perfectly OK. Can anyone help.
|
|
|
|
|
I'm getting a weird problem while reading the standard output from a process I've created while its running. The console output from the process is A, B, C, D, E but for some reason I am getting the output from standard out as A, B, C, E, D. Has anyone encountered this before?
I'm using a separate thread to read standard out and push the results to a Queue which is then read by the main application and displayed in a text window.
Writing to the Queue in the thread:
ConsoleLine = null;
while( (ConsoleLine MyProcess.StandardOutput.ReadLine()) != null )
{
ConsoleLine += System.Environment.NewLine;
lock( m_OutputQueue.SyncRoot )
{
m_OutputQueue.Enqueue( ConsoleLine );
}
ConsoleLine = null;
}
Reading from the Queue and updating application:
do
{
while( (StdStreamReader.m_OutputQueue.Count>0) && (i<5) )
{
// get output from queue
ConsoleLine = StdStreamReader.m_OutputQueue.Dequeue() as string;
//process output
if( globals.ProcessBuildOutput( ConsoleLine ) )
{
bErrors = true;
}
i++;
}
// let the app do some housekeeping
Application.DoEvents();
//Give the process some room to breath
System.Threading.Thread.Sleep( 100 );
}while( !MyProcess.HasExited );
|
|
|
|
|
Holla.
I have a little question here:
How to I pipe a processes standard input or output somewhere else?
I mean: I want to run a Console App as a process. This, of course, means that I dont want the console to display (if I wanted that, I would use Process.Start("cmd.exe","/C ConsApp.exe").
However, I have some difficultied rerouting the StandardOutput to a richTextBox.
How do I do this - it always tells me that StandardOut is read-only?!
Cheers
Sid
P.S.: Tired and confused
|
|
|
|
|
And YES, I did use a Stream. I just thought that seeing some basically working code might help?
Could you post some example code which outputs the result of "type text.txt" to a textbox, so I can see some complete code?
Cheers
Sid
P.S.: process' and difficulties. Consider my prior post corrected
|
|
|
|
|
How to obtain the server name of the one machine or the office land online SQL SERVER2000?
|
|
|
|
|
The problem has been solved with sqldmo
but How to get the password of sa user of Sql Server2000?
|
|
|
|
|
I need code to verify email in win form, help!
|
|
|
|
|
You'll have to be alot more specific about what you want. Verify an email? I take that to mean "does it conform to the RFC specification". Or are you trying to verify an email address is in the correct format? Are you trying to find out if the email address even exists? (Can't be done BTW...)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would like to verify an email address as if it is in the correct format, can you help?
|
|
|
|
|
Simple. You can use a Regular Expression to check the format and legal characters.
See my last post on this here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i using matlab in calcul power system i don't know how convert matlab file exe or m file in c# to using gui in c#. and how c# acess to m file in matlab.
|
|
|
|
|
How could I order "categories" in the propertygrid according to my will?
|
|
|
|
|
Depends...
if it is your own properties use the Category attribute:
[Category("MyCategory")]
public int MyInt
{
get{...}
set{...}
}
if you whant to change category on derived properties, u have to override the properties and do as above, but alas not all properties can be overridden.
-spif2001
|
|
|
|
|
I believe I saw (on Google somewhere) that adding multiple \t 's before the category name allows you to change the order.
Never tried it though
|
|
|
|
|
Thanks a lot for your message!
But my question was about ordering of "categories" for propertygrid representation.
I know how to use this attribute.
|
|
|
|
|
I want to add a column to my data grid for a treeview structure; where every cell in the column would be a TreeNode object. I wrote a class DataGridTreeNodeColumn that overrides DataGridColumnStyle but you can't just draw a single TreeNode. You have to add the TreeNode to the TreeView and use the TreeView to draw it.
Is it even possible to put a treeview inside a datagrid using this method? Is there another way of doing it? Are there any tutorials that explain how to do this? Thanks in advance.
|
|
|
|
|
Hi
Is there a event which fires when any text gets in to the textbox, either i type or copy paste. I know its possible in keypress and mousedown events but i want a single event where i can identify when a text gets into a textbox. plz do reply if its possible or not.
Cheers!
Cheetu
|
|
|
|
|