Solved

Explenation needed about a methode

Posted on 2011-03-17
2
202 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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