FerroCoder
Member
- Joined
- Jul 20, 2023
- Messages
- 18
- Programming Experience
- 10+
Hi,
I have a TreeView object in a form that is not displaying its nodes. Repeated calls to the method noted here update editorTestDefinition properly, where editorTestDefinition is the TreeView object. Text values and image indices are correct. No exceptions are thrown and the validation loop shows that the TreeView object is being updated appropriately.
However, after repeated calls, this remains the window view:
The tree is docked to the parent window. There are no other elements in the EDITOR window that could mask the tree.
Essentially identical code works for other trees in other windows. Direct comparison between working windows' and tree controls' properties and these form/TreeView properties show no substantive differences.
Adding a node at design time displays the added node on execution.
Note that all elements in the tree are at the root level, suggesting a list box. I have tried a list box, using only text entries, and I get the same behavior. This suggests to me that there is something about the form, and not the tree control, that is causing this behavior.
The IDE is VS 2022 and .NET 6.0 is targeted.
Any help leading me to my error would be greatly appreciated.
Thanks,
FC
I have a TreeView object in a form that is not displaying its nodes. Repeated calls to the method noted here update editorTestDefinition properly, where editorTestDefinition is the TreeView object. Text values and image indices are correct. No exceptions are thrown and the validation loop shows that the TreeView object is being updated appropriately.
C#:
public void add_task( CTask Task )
{
TreeNode l_tnTreeEntry = new TreeNode();
l_tnTreeEntry.Text = Task.get_task_name();
l_tnTreeEntry.ImageIndex = Task.get_no_execute()? 0 : Task.get_editor_icon_list_index();
l_tnTreeEntry.SelectedImageIndex = Task.get_no_execute()? 0 : Task.get_editor_icon_list_index();
l_tnTreeEntry.EnsureVisible(); // Added to try to force the node to appear.
int l_iIndex = editorTestDefinition.Nodes.Add( l_tnTreeEntry ); // editorTestDefinition is the TreeView object.
// Validate TreeView status
for( int i = 0; i <= l_iIndex; i++ )
{
String l_sIcon = editorTestDefinition.Nodes[ i ].Text;
int l_iImageIndex = editorTestDefinition.Nodes[ i ].ImageIndex;
} // for( int i = 0; i <= l_iIndex; i++ )
return;
} // public void add_task( CTask task )
However, after repeated calls, this remains the window view:
The tree is docked to the parent window. There are no other elements in the EDITOR window that could mask the tree.
Essentially identical code works for other trees in other windows. Direct comparison between working windows' and tree controls' properties and these form/TreeView properties show no substantive differences.
Adding a node at design time displays the added node on execution.
Note that all elements in the tree are at the root level, suggesting a list box. I have tried a list box, using only text entries, and I get the same behavior. This suggests to me that there is something about the form, and not the tree control, that is causing this behavior.
The IDE is VS 2022 and .NET 6.0 is targeted.
Any help leading me to my error would be greatly appreciated.
Thanks,
FC