|
hi
at the moment i'm handling the doubleclick event.
how can i check whether a leaf node was doubleclicked or whether the user just double clicked whitespace?
thanks
|
|
|
|
|
Handle MouseDoubleClick event and then create instance of TreeViewHitTestInfo based on the parameter of the event
|
|
|
|
|
I use things like:
private void tvReports_MouseDoubleClick ( object sender , System.Windows.Forms.MouseEventArgs e )
{
System.Windows.Forms.TreeNode nod ;
if
(
( e.Button == System.Windows.Forms.MouseButtons.Left )
&&
( ( nod = this.tvReports.GetNodeAt ( e.Location ) ) != null )
)
{
|
|
|
|
|
I use things like this:
TreeViewHitTestInfo hit=treeview1.HitTest(e.Location)
you should write it in the event handler of OnNodeMouseDoubleClick
|
|
|
|
|
|
In my application based on framework 2.0 I want to give the user the possibility to create templates for a tree view. That is, I want to display a table (e.g., a DataGridView) that contains all the node names of the tree view and give the user the chance to define his own node names in a template (for example a different language). All my tree node names are stored in a resx file in my application. Do you have any idea how to implement something like this? Thanks.
|
|
|
|
|
Hi all!
I newbie programmer, and I finished a Windows application using C# 2.0 (VS 2005). All labels and menues in the Windows forms are in English but I'd like those labels and menues could change the language according to the chosen settings by the user.
Which is the best way to code a program with multi language labels and menues?
I'd appreciate any information about this subject.
Thank you in advance.
--
Adrián Córdoba
|
|
|
|
|
You should use resources and retrieve string during runtime
|
|
|
|
|
|
Thank you. I'll check those links.
--
Adrián Córdoba
|
|
|
|
|
Hi
I have tried the following code in Form's constructor
<br />
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");<br />
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US"); but it doesn't work in other dlls which are used by the applicaiton (form).
How to achieve this?
Thanks
srini
|
|
|
|
|
I typically set the Application.CurrentCulture property in addition to the thread properties.
Are you sure that the DLLs make use of the thread's culture settings? Maybe their localisation is hard-coded or they utilize the OS culture (CultureInfo.InstalledUICulture ).
Regards,
Tim
|
|
|
|
|
Hi
How can we make sure the dlls are using thread's culture settings?
We just created dlls without touching any culture informations. But our OS is running on UK culture, thats why it is dispalying in DD/MM/YYYY format
Actually in my application i have some calendar controls where it is displaying US format (after i made that culture change), but the data which i am getting from other dlls are in "DD/MM/YYYY" format!
I thought changing the culture info of current thread will impact the referring dlls is it correct?
Thanks
srini
|
|
|
|
|
You should not force your culture on a client.
The client's system settings should be used.
If you must force a date/time format it should be ISO 8601.
|
|
|
|
|
no.... all our application is following US datetime format.. if somebody installed OS on UK culture.. then our application must send the datetime in US format irrelevant of system culture. Thats why we need to do this change.
|
|
|
|
|
Too bad - then your application has been developed by some pretty incompetent people.
Your program should always use DateTime objects internally. If it needs to represent the date as a string, then do it using the ISO format mentioned. Preferably the internal format is UTC as well, unless there is an extremely good reason for it to be kept in local time.
Various user interface controls (like your calender) should map to the users culture without problems (if it doesn't, ditch it and use something better).
When interfacing the non-ISO system, encode to and from the specific format at the interface point - never let the bad format requiremen polute your internal program structure, and above all, never EVER let it polute the user interface.
|
|
|
|
|
Hey Everyone,
I have a DataTable exposed to the user through a DataGridView. When a user types in a value for some cells, it triggers events to update other cells. For all my updates, I am updating the underlying databound DataTable, not the DataGridView.
My problem is that in some very rare cases, the data does not show up on the DataGridView. Using the exact same scenarios, updates sometimes work, sometimes not. If I step through the code I can see that the DataTable has the correct values and then I call DataGridView.Refresh() and the display is wrong.
Has anyone had issues with the databindings or know work arounds short of re-writing the code to manage the Table and Grid independantly?
Thanks in advance,
Pualee
P.S. I have removed all possibility of Background threads. There are only events and the GUI to deal with. I have also made sure the events are not overwriting each other (I think).
|
|
|
|
|
hi
i want to change color of diacritics(accent) of font of my text, but how to do ?
|
|
|
|
|
You can't change the color on a part of a character. You have to replace the character that has an accent with it's base character and an accent character, so that you can write them out separately with different colors.
---
single minded; short sighted; long gone;
|
|
|
|
|
i searched in msdn and found _Font.DiacriticColor property in Microsoft.Office.Interop.Word NameSpace, but i doesn't found in references in my VS2005 solution (office 2007 has been installed on my computer).
how to use this namespace to set DiacriticColor ? thanks
|
|
|
|
|
This will only work inside of Word in a Word document. It will NOT work in your application.
|
|
|
|
|
There is no such property outside of Word. A character with a diacritic is just a character that is shaped differently, there is no information in the font that says what part of the character is a diacritic, so the text drawing routines have no way of automatically separating them.
Word does it by separating the characters and the diacricics and drawing them separately, the way that I described.
---
single minded; short sighted; long gone;
|
|
|
|
|
I Know Ican get my computer's environment variables that use Environment.GetEnvironmentVariables()
but how can I get variables from computer in network.
|
|
|
|
|
Don't the environment variables depend on the user that is logged in and the context in which the application is running.
For example, the environment variables I see are different from those my colleague sees when he logs in. And the environment variables that are available in the Visual Studio command prompt are different from those available in the regular system command prompt.
From a remote perspective this question needs to resolve these ambiguities. From a local perspective calling Environment.GetEnvironmentVariables will only ever give you the variables that are available to you in the context in which the application is running.
|
|
|
|
|
Yes,I think I can solve this question from your answer
thanks
|
|
|
|