DevExpress TreeList用法总结

http://blog.itpub.net/29251214/viewspace-774395/

http://blog.csdn.net/czp_huster/article/details/50184691

http://www.cnblogs.com/Lixinhua-GoOn/p/4046042.html

dev treelist控件,显示3角符,或显示+ -符的控制

解决方案1:

  在 program.cs中把 下面一句暂时注解,你就会发现所有的 treelist会自动显示 + -号;

     如果放出来,就显示3角符


        DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("DevExpress Style");

解决方案2:

   自己画+-号

private void treeList1_CustomDrawNodeButton(object sender, DevExpress.XtraTreeList.CustomDrawNodeButtonEventArgs e)  
{  
    Brush backBrush = new System.Drawing.Drawing2D.LinearGradientBrush(e.Bounds, Color.White, Color.Black,  
em.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal);  
    e.Graphics.FillRectangle(backBrush, e.Bounds);  
    // painting 3D borders  
    ControlPaint.DrawBorder3D(e.Graphics, e.Bounds, Border3DStyle.Flat);  
  
    // determining the character to display  
    string displayCharacter = e.Expanded ? "-" : "+";  
    // formatting the output character  
    StringFormat outCharacterFormat = new StringFormat();  
    outCharacterFormat.Alignment = StringAlignment.Center;  
    outCharacterFormat.LineAlignment = StringAlignment.Center;  
  
    // painting the character  
    e.Graphics.DrawString(displayCharacter, new Font("Verdana", 8),  
      new SolidBrush(Color.White), e.Bounds, outCharacterFormat);  
  
    // prohibiting default painting  
    e.Handled = true;  
  
}

  

原文地址:https://www.cnblogs.com/marblemm/p/7364737.html