解决方案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;
- }