This should work, but you can also get the edit control (a TextBox in .NET) that the Tree-View common control uses during label edits by handling the TVN_BEGINLABELEDIT notification message in TreeView.WndProc and then call a P/Invoked SendMessage with the TVM_GETEDITCONTROL:
Why not just read this into a string, or better yet a StringBuilder (which is mutable). If you store the reference to this StringBuilder you can keep appending to it. Just use StringBuilder.ToString() to get the actual String.
Another way would be to use a MemoryStream and wrap your StreamWriter or StreamReader around it.
One unrelated thing to your question: instead of concatenating strings that represents directories, you should use Path.Combine to take into account the OS's path separator (\, :, /) and to ensure that - if the WorkingDir doesn't not end with a path separator - that it is added before appending the filename (or additional directory name(s)).
bouli wrote: 1) What is the equivalent of Win32 GetSysColor() function in .NET?
It is System.Drawing.SystemColors class
bouli wrote: 2) I would like to have the equivalent in C# (.NET) of the following C++ (MFC) statement:
class CMyWindow : public CWnd
While CWnd is an MFC class that represents a basic window.
I want to write my own control and use it
Use System.Windows.Forms.Form for forms(dialogs). But for controls like button, user-controls use System.Windows.Forms.UserControl or Control. Here big difference between MFC and .NET. In MFC can be CWnd dialog and control(I used these for nested dialogs - one dialog owns another), but in .NET only classes delivered from System.Windows.Forms.Form can be dialogs and cannot contain any forms.
Right click on your ToolBox and select 'Customize ToolBox' option. From .NET Component tab, with Browse button , select assembly of your control and click OK. It is now added to your toolbox and you can drag and drop it on your form.
No sig. available now.
Last Visit: 31-Dec-99 19:00 Last Update: 5-Dec-23 15:54