Bug in TreeView.dll/ControlsEx.dll?

Discussion in 'Bug Reports' started by specci48, Sep 25, 2007.

  1. specci48

    specci48 Well-Known Member Licensed User

    Hi guys,

    if I run this piece of code (see attachment) on the desktop, the checked node2 jumps up and down every time I press the button "jump"... ;)
    If I run this code on the device, the both nodes still flip up and down, but the "checked"-information of node2 get's lost... :(

    Is it a bug in the dll or in .Net CF?


    specci48
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Apparently the .Net CF treats differently checks by code and checks by clicking with the mouse (pen).
    The checks that were done by the mouse are cleared when the node is removed from the tree, while the checks that were done by code do remain.
     
  3. specci48

    specci48 Well-Known Member Licensed User

    :confused: ???
    As you can see in my example, the node is checked by code and not by mouse/pen. According to your explanation the checked box should remain but in fact it gets cleared! Even I check the node by pen on the device, it gets cleared, too.


    specci48
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Here is a workaround for this issue (which is a .Net CF issue):
    Make sure to use the updated ControlsEx library.
    Code:
    Sub Globals

    End Sub

    Sub App_Start
        Init
        FMain.Show
    End Sub

    Sub Init 
        Tree1.New1(
    "FMain",5,5,230,230)
        Tree1.CheckBoxes = 
    True
        node1.New1
        node1.Value = Tree1.AddNewNode(
    "Node1")
        node1.Value = Tree1.AddNewNode(
    "Node2")
        node1.Checked = 
    True
    End Sub

    Sub BtnJump_Click
        node1.Value = Tree1.GetNode(
    1)
        Tree1.RemoveNodeAt(
    1)
        Tree1.InsertNode(
    0, node1.Value)
    End Sub

    Sub Tree1_AfterCheck
          
    If tree1.Action = "unknown" Then Return
          node1.Value = tree1.CheckedNode
          node1.Checked = node1.Checked
    End Sub
     
  5. specci48

    specci48 Well-Known Member Licensed User

    Thanks Erel, that's the same solution I did implement for myself (so I did it right... ;))
    I only wondered about your first answer which didn't expain the actual behavior.


    specci48
     
Loading...