Solved

Explenation needed about a methode

Posted on 2011-03-17
2
203 Views
Last Modified: 2013-12-17
Hi,

Can someone explain the following lines for me:

        private void tvNotes_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
         try
         {
             if (e.Label.Trim().Length < 1) { e.CancelEdit = true; }  
             EditNode(tvNotes.SelectedNode,e.Label);                  <=====
             tvNotes.SelectedNode.EndEdit(false);          <=========
             tvNotes.LabelEdit = false;   <========
         }
         catch (Exception err) { MessageBox.Show(err.Message); }
         }


Grtz, Peter Kiers
0
Comment
Question by:peterkiers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
wdosanjos earned 500 total points
ID: 35159342
            EditNode(tvNotes.SelectedNode,e.Label);                  <=====

Calls a method named EditNode on the current class, passing the selected tree node and the new label string.

             tvNotes.SelectedNode.EndEdit(false);          <=========

Saves the changes to the selected tree node, and updates the screen with the change.

             tvNotes.LabelEdit = false;   <========

Indicates that the TreeView node labels cannot be edited.


I hope this helps.
0
 
LVL 11

Expert Comment

by:wrmichael
ID: 35159346
 private void tvNotes_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
         try
         {
             if (e.Label.Trim().Length < 1) {

              //this cancels the labeledit if the length is of the label is less than 1 or blank
              e.CancelEdit = true;


 }  
             //this looks like a function.  do you have the code for it?
             EditNode(tvNotes.SelectedNode,e.Label);                  <=====
            //not sure
             tvNotes.SelectedNode.EndEdit(false);          <=========
//stop people from editing            
tvNotes.LabelEdit = false;   <========
         }
         catch (Exception err) {
//shows error
MessageBox.Show(err.Message); }
         }
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question