Results 1 to 7 of 7

Thread: TreeView Cancel Expand/Collapse

  1. #1

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    TreeView Cancel Expand/Collapse

    Is there anyway to avoid a node to be collapsed or expanded when doubled-click. I know I can expand and/or collapse the node in the DoubleClick event... but I don't wan't the user to see the expand and collapse -or collapse and expand regarding it's initial status). TIA,
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: TreeView Cancel Expand/Collapse

    I guess maybe you count mouseclicks in the MouseDown events and trap the BeforeExpand/Collapse events (Ithink that's what they're called) to cancel the expand/collapse and reset the mouseclick counter. Also you would need some sort of timer to reset the mouseclick counter as well. Seems a bit of a crude hack though, must be a better way of doing it.

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: TreeView Cancel Expand/Collapse

    Also maybe something on this page might help you.

  4. #4

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: TreeView Cancel Expand/Collapse

    Quote Originally Posted by penagate
    I guess maybe you count mouseclicks in the MouseDown events and trap the BeforeExpand/Collapse events (Ithink that's what they're called) to cancel the expand/collapse and reset the mouseclick counter. Also you would need some sort of timer to reset the mouseclick counter as well. Seems a bit of a crude hack though, must be a better way of doing it.
    I only found these events on .Net. Does VB6 also have them?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: TreeView Cancel Expand/Collapse

    Quote Originally Posted by Mc Brain
    I only found these events on .Net. Does VB6 also have them?
    Yes I just looked them up, they are called Expand and Collapse

  6. #6

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: TreeView Cancel Expand/Collapse

    Quote Originally Posted by penagate
    Also maybe something on this page might help you.
    Ok, I might not explain myself correctly. I want to cancel the expand/collapse if the user double-clicks only. That example avoids to expand/collapse even with the "+" and "-".
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  7. #7

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: TreeView Cancel Expand/Collapse

    Quote Originally Posted by penagate
    Yes I just looked them up, they are called Expand and Collapse
    Yes, but those events fires after the action itself. So, when I get to this point... the node has already been expanded or collapsed. I know I can collapse it or expand it but this is the flickering I want to avoid.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width