treeview

Win32 Custom Draw Treeview Control

半世苍凉 提交于 2021-01-28 00:49:34
问题 I'm trying to customize a treeview control using NM_CUSTOMDRAW messages. I simply want to draw every other visible item with a grey color. Here is code to draw: INT CResourceOutliner::On_WM_NOTIFY( HWND hDlg, WPARAM wParam, LPARAM lParam ) { HWND hTree = GetDlgItem( hDlg, IDC_TREE1 ); switch( ( ( LPNMHDR )lParam )->code ) { ... case NM_CUSTOMDRAW: { LPNMTVCUSTOMDRAW pCustomDraw = ( LPNMTVCUSTOMDRAW )lParam; switch( pCustomDraw->nmcd.dwDrawStage ) { case CDDS_PREPAINT: return CDRF

Is there a way to change height of tkinter Treeview heading?

对着背影说爱祢 提交于 2021-01-27 22:57:06
问题 I got a problem with changing the height of the Treeview.heading . I have found some answers about the dimensions of Treeview.column , but when I access Treeview.heading in the documentation, there is not a single word about changing the height of the heading dynamically when the text doesn't fit (and wrapping it) or even just hard-coding height of the heading in pixels. I don't have to split the text to two rows, but when I just keep it that long the whole table (as it has many entries)

TreeViewItem - Use ControlTemplate and HierarchicalDataTemplate together

孤街浪徒 提交于 2021-01-27 12:49:22
问题 I'm using HierarchicalDataTemplate in my TreeView, and I wanted to also overwrite the default template for the TreeViewItem so that when an item is selected, it only highlights the text, not including the icon next to it. <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Children}"> <TreeViewItem Style="{StaticResource TreeViewItemStyle}" Header="{Binding DisplayText}" /> </HierarchicalDataTemplate> </TreeView.ItemTemplate> <TreeView.Resources> <Style x:Key=

How to stop the treeview collaps event after mouse click

三世轮回 提交于 2021-01-27 12:36:01
问题 How can I stop the treeview collaps event after mouse click on TreeViewItem arrow (on view)? I need to show my treeview expanded all time. 回答1: You could set the Collapsed event in XAML: <TreeView Name="myTreeView" ItemsSource="{Binding dataSource}"> <TreeView.ItemContainerStyle> <Style TargetType="TreeViewItem"> <Setter Property="IsExpanded" Value="True" /> <Style.Triggers> <EventTrigger RoutedEvent="Collapsed"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard>

Expand selected node after refresh TreeView in C#

偶尔善良 提交于 2021-01-24 07:08:20
问题 I have a treeview with many items When I expand an item and its childs and after I called refresh method, that expanded item childs becomes collapsed. Can you give me an idea how to store the selected node and after refresh, to call the Expand method again... I tried : TreeNode selectedNode = new TreeNode(); TreeNode selectedNode = SelectedTreeNode(); //method which takes selected node from TV RestoreFolderTreeWithLastSelectedItem(); //method which initialise treeview object //here I want to

Expand selected node after refresh TreeView in C#

穿精又带淫゛_ 提交于 2021-01-24 07:07:59
问题 I have a treeview with many items When I expand an item and its childs and after I called refresh method, that expanded item childs becomes collapsed. Can you give me an idea how to store the selected node and after refresh, to call the Expand method again... I tried : TreeNode selectedNode = new TreeNode(); TreeNode selectedNode = SelectedTreeNode(); //method which takes selected node from TV RestoreFolderTreeWithLastSelectedItem(); //method which initialise treeview object //here I want to

How to change background/foreground of item in Treeview by tag?

 ̄綄美尐妖づ 提交于 2021-01-20 07:50:28
问题 I want to apply different background for tags in Treeview but when I set tag for example as "minus" and try to configure tag to have black background it stills returns white background. I've tried applying Style and set background to desired RGB to Treeview but background remains white. I've also tried to set tags and configure tag background to desired RGB but it is still returned as white! for row in rows: self.treeplan.insert('', 'end', text=str(cpt), values=(row[1], row[2], row[3], row[4]

C#treeview控件的异步更新

穿精又带淫゛_ 提交于 2021-01-15 02:16:33
在进行Winform程序开发需要进行大量的数据的读写操作的时候,往往会需要一定的时间,然在这个时间段里面,界面ui得不到更新,导致在用户看来界面处于假死的状态,造成了不好的用户体验。所以在大量数据操作的应用上,需要使用多线程来处理这种情况。在c#中使用多线程很方便只需要使用System.Threading.Thread的一个实例的Start方法就行了,但是如何实现多线程之间的交互就不是那么简单。本文实现了用子线程去处理数据,并实时更新主线程的ui状态了。 1、首先要建立一个委托来实现非创建控件的线程更新控件。 2、然后编写多线程去启动写入数据的方法以及回调的函数。 public partial class ucPrice : UserControl { SQLiteConnection conn; //定义委托 delegate void inittvItemsDelegate(); delegate void AsynUpdateUI1(string step); //更新UI1 delegate void AsynUpdateUI2(TreeNode root);//更新UI2 public delegate void UpdateUI(string step);//声明一个更新主线程的委托 public UpdateUI UpdateUIDelegate; public

How can I eliminate the lines in TreeView while keeping all arrows

独自空忆成欢 提交于 2021-01-06 03:53:06
问题 I have a TreeView which I am skinning using the SetWindowsTheme() pinvoke, however I am unable to remove the tree lines that appear. I do not wish to do 'Owner' drawn as I believe that would be the equivalent of taking an 18-wheeler truck to deliver one taco (overkill). What is a clean, quick way to eliminate the Tree forks while keeping the expansion arrows. (I need to keep the arrows on the root nodes as well) should look like : 回答1: Try this: yourTreeView.ShowLines = false; yourTreeView

How can I eliminate the lines in TreeView while keeping all arrows

被刻印的时光 ゝ 提交于 2021-01-06 03:49:03
问题 I have a TreeView which I am skinning using the SetWindowsTheme() pinvoke, however I am unable to remove the tree lines that appear. I do not wish to do 'Owner' drawn as I believe that would be the equivalent of taking an 18-wheeler truck to deliver one taco (overkill). What is a clean, quick way to eliminate the Tree forks while keeping the expansion arrows. (I need to keep the arrows on the root nodes as well) should look like : 回答1: Try this: yourTreeView.ShowLines = false; yourTreeView