Bug in TreeView.dll/ControlsEx.dll?

specci48

Well-Known Member
Licensed User
Longtime 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
 

specci48

Well-Known Member
Licensed User
Longtime 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
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Here is a workaround for this issue (which is a .Net CF issue):
Make sure to use the updated ControlsEx library.
B4X:
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
 

specci48

Well-Known Member
Licensed User
Longtime 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
 
Top