Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Explenation needed about a methode

Posted on 2011-03-17
2
Medium Priority
?
205 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

636 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