?
Solved

Explenation needed about a methode

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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

771 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