With VB.NET, adding a button to each node in a treeview

Posted on 2006-04-05
Last Modified: 2006-11-18
Is it possible to add a button in each node of a treeview next to the text or the display picture?  This is needed to eliminate the need to right click and display a menu or some other function.
Question by:ddepuemd
    LVL 1

    Expert Comment


    you can add a checkbox to your treeview nodes instead of button which comes as a property of .net treeview control and wontbe much of a hastle either.

    now based upon the selection/de-selection of these check boxes you can call any method you like.

    if you wish i can also guide with some code to help you out on this.


    Author Comment

    I have my treeview populated with checkboxes already.  Is there a way to also add a button?
    LVL 25

    Accepted Solution

    I don't think you can do it, at least in 2003, because I don't see any way to override the paint event in the TreeNode class, which is the only way I could think of doing this.  This would not be a trivial task even if it were doable.

    Author Comment

    ok, can I have my points back please?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    Title # Comments Views Activity
    sumNumber challenge 16 78
    copyEvens challenge 6 46
    countPairs challenge 7 37
    wordlen challenge 3 28
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    A short article about a problem I had getting the GPS LocationListener working.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now