Results 1 to 9 of 9

Thread: Treeview

  1. #1

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    if i remove a node that is being selected, or have been selected recently, the blue box around the next selected item will stay even if i try to select another item, it will jump to the new selected item but then jump back to the item first clicked after the node has been removed.
    Code:
    Private Sub Form_Load()
        TreeView1.LineStyle = tvwRootLines
        TreeView1.Nodes.Add TreeView1.Nodes.Add(, , , "A"), tvwChild, , "B"
        TreeView1.Nodes.Add , , , "C"
    End Sub
    
    Private Sub TreeView1_DblClick()
    On Error Resume Next
        With TreeView1.SelectedItem
            Set TreeView1.SelectedItem = Nothing
            'For n = 0 To 20000
            '    DoEvents
            'Next n
            TreeView1.Nodes.Remove .Index
        End With
    End Sub
    This sample demonstrates the bug, expand the node, and doubleclick on B ot remove it


    if i uncomment the for next loop, it will work, most of the time, with 10000 cycles, it will fail more often.
    Is there any other way around this problem?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  2. #2
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    Hi, I tried the code, when I double-click on item B, it gets removed and the blue box just disappears. Is that what you meant?

  3. #3

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    well now if you have completed that, click on either C or A, then click on the other, and try that, it doesn't move from the one you clicked first.

    I tried doing this in the mouseup event and it works, but what's wrong with doubleclicking our mousedown?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    Sorry, it works fine here...

  5. #5

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Hmm, thats odd, what version of mscomctl.ocx do you have? mine is 6.00.8177
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    My version: 6.00.8862

    Also, when selecting it, it shows SP4 (where that came from, no idea, it was just there one day...)

  7. #7

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    can you send that to me? ([email protected])
    Would be appreciated
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  8. #8
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    It should arrive shortly in your Hotmail box... hope this solves your problem!

  9. #9

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Yes! it works, thanks a lot but it flickers instead, well doesn't matter now thanks again.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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