Click here to Skip to main content
15,893,266 members
Home / Discussions / C#
   

C#

 
GeneralRe: how can i do this Controls c# Pin
OriginalGriff29-May-10 0:43
mveOriginalGriff29-May-10 0:43 
Questiondelegate invocation Pin
xilefxilef28-May-10 20:06
xilefxilef28-May-10 20:06 
AnswerRe: delegate invocation Pin
Moreno Airoldi28-May-10 22:36
Moreno Airoldi28-May-10 22:36 
AnswerRe: delegate invocation Pin
PIEBALDconsult29-May-10 3:20
mvePIEBALDconsult29-May-10 3:20 
GeneralRe: delegate invocation Pin
xilefxilef29-May-10 18:34
xilefxilef29-May-10 18:34 
GeneralRe: delegate invocation Pin
Moreno Airoldi29-May-10 21:05
Moreno Airoldi29-May-10 21:05 
GeneralRe: delegate invocation Pin
xilefxilef30-May-10 0:07
xilefxilef30-May-10 0:07 
GeneralRe: delegate invocation Pin
Moreno Airoldi30-May-10 2:36
Moreno Airoldi30-May-10 2:36 
I made a few tests, and it seems the problem is not with delegate invocation.
If you disable all events and try this:

C#
DateTime Start = DateTime.Now;
string MyLabel = "Test";
for (int i = 0; i < treeView.Nodes.Count; i++)
{
    treeView.Nodes[i].Text = MyLabel;
}
TimeSpan ts = DateTime.Now.Subtract(Start);
MessageBox.Show(ts.TotalSeconds.ToString("0.000"));


You'll see it takes just the same time. So, the problem is the time the TreeNode component takes to update its text.

I tried disabiling on-screen updating, with Visible, Enabled, SuspendLayout() / ResumeLayout() and the WM_SETREDRAW window message, but it doesn't seem to gain you time.

So, I'm afraid you cannot make it faster unless you design your own TreeView / TreeNode classes optimizing them for text updating. If that's possible.

Good luck, let me know if you find any solution. Smile | :)
2+2=5 for very large amounts of 2
(always loved that one hehe!)

GeneralRe: delegate invocation Pin
PIEBALDconsult30-May-10 6:21
mvePIEBALDconsult30-May-10 6:21 
GeneralRe: delegate invocation Pin
xilefxilef30-May-10 19:26
xilefxilef30-May-10 19:26 
GeneralRe: delegate invocation Pin
xilefxilef30-May-10 20:07
xilefxilef30-May-10 20:07 
QuestionDebugging a Native DLL From a C# Assembly Pin
Richard Andrew x6428-May-10 11:33
professionalRichard Andrew x6428-May-10 11:33 
AnswerRe: Debugging a Native DLL From a C# Assembly Pin
William Winner28-May-10 11:42
William Winner28-May-10 11:42 
AnswerRe: Debugging a Native DLL From a C# Assembly Pin
Luc Pattyn28-May-10 11:56
sitebuilderLuc Pattyn28-May-10 11:56 
GeneralRe: Debugging a Native DLL From a C# Assembly Pin
Richard Andrew x6428-May-10 12:00
professionalRichard Andrew x6428-May-10 12:00 
GeneralRe: Debugging a Native DLL From a C# Assembly Pin
Luc Pattyn28-May-10 12:02
sitebuilderLuc Pattyn28-May-10 12:02 
QuestionExcel Problem Pin
snouto28-May-10 10:43
snouto28-May-10 10:43 
AnswerRe: Excel Problem Pin
William Winner28-May-10 11:39
William Winner28-May-10 11:39 
GeneralRe: Excel Problem Pin
snouto28-May-10 11:59
snouto28-May-10 11:59 
GeneralRe: Excel Problem Pin
Eddy Vluggen29-May-10 0:37
professionalEddy Vluggen29-May-10 0:37 
QuestionDateTimePicker as only Time Picker help - need dropdown to only show times (not calendar) or show nothing at all Pin
roman_s28-May-10 8:53
roman_s28-May-10 8:53 
AnswerRe: DateTimePicker as only Time Picker help - need dropdown to only show times (not calendar) or show nothing at all Pin
Alan N28-May-10 11:05
Alan N28-May-10 11:05 
AnswerRe: DateTimePicker as only Time Picker help - need dropdown to only show times (not calendar) or show nothing at all Pin
Isaac Gordon29-May-10 2:04
Isaac Gordon29-May-10 2:04 
QuestionFighting for Top-Most Window in WinCE Pin
notsotragichero28-May-10 6:51
notsotragichero28-May-10 6:51 
AnswerRe: Fighting for Top-Most Window in WinCE Pin
PIEBALDconsult28-May-10 13:13
mvePIEBALDconsult28-May-10 13: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.