Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1635
TreeNodeExpansionIndicator question
posted

We have Windows Treeviews where we want the expansion indicators to be the arrows rather than + -. We created an AppStylist Windows 7 isl file for UltraGrids where the TreeNodeExpansionIndicator UIRole is left as not updated. We added the following code to our base TreeView control

[DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]

private extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList);

protected override void CreateHandle()

{

     base.CreateHandle();

     SetWindowTheme(this.Handle, "explorer", null);

}

This works great for Treeviews on Windows 7 machines, but on Windows XP SP3 machines, the + - expansion indicators still display. Would adding the arrows to the

TreeNodeExpansionIndicator UIRole have any effect for XP or does only apply to Infragistics tree views? Is there any solution for this? Thank you.

Ron


 

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi Ron,

    I'm afraid I'm confused. Are you using UltraWinTree or the inbox TreeView control?

    The SetWindowTheme API will not have any effect on the Infragistics UltraTree, and AppStylist will not have any effect on the inbox TreeView control.

    I'm having trouble understanding how AppStylist relates to the issue. If you are using UltraWinTree, then you could use AppStylist or code to set the UltraTree's DisplayStyle to WindowsVista, which is the style that uses arrows instead of plus/minus signs.

    If you are using the inbox TreeView, then it makes sense that SetWindowTheme doesn't work on Windows XP, because the style of tree you want didn't exist in Windows XP. It was introduced in Windows Vista.

Children