DevStyle.SetTreeListSelectStyle 设置TreeList组件只读状态(用于选择)
DevStyle.SetTreeListSelectStyle 设置TreeList组件只读状态(用于选择)
扫一扫加微信
C# Code:
/// <summary>
/// TreeList组件只读,用于选择
/// </summary>
/// <param name="tree"></param>
public static void SetTreeListSelectStyle(TreeList tree)
{
tree.Appearance.Empty.BackColor = System.Drawing.Color.WhiteSmoke;
tree.Appearance.Empty.Options.UseBackColor = true;
tree.Appearance.Row.BackColor = System.Drawing.Color.WhiteSmoke;
tree.Appearance.Row.Options.UseBackColor = true;
//Appearance.HideSelectionRow
tree.Appearance.HideSelectionRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
tree.Appearance.HideSelectionRow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
tree.Appearance.HideSelectionRow.Options.UseBackColor = true;
tree.Appearance.HideSelectionRow.Options.UseForeColor = true;
//Appearance.SelectedRow
tree.Appearance.SelectedRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
tree.Appearance.SelectedRow.ForeColor = System.Drawing.Color.Red;
tree.Appearance.SelectedRow.Options.UseBackColor = true;
tree.Appearance.SelectedRow.Options.UseForeColor = true;
//Options
tree.OptionsBehavior.Editable = false;
tree.OptionsSelection.EnableAppearanceFocusedCell = false;
tree.OptionsView.ShowHorzLines = false;
tree.OptionsView.ShowVertLines = false;
tree.TreeLineStyle = DevExpress.XtraTreeList.LineStyle.Percent50;
tree.OptionsView.ShowRoot = true;
tree.LookAndFeel.UseDefaultLookAndFeel = false;
tree.LookAndFeel.UseWindowsXPTheme = true;
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
/// <summary>
/// TreeList组件只读,用于选择
/// </summary>
/// <param name="tree"></param>
public static void SetTreeListSelectStyle(TreeList tree)
{
tree.Appearance.Empty.BackColor = System.Drawing.Color.WhiteSmoke;
tree.Appearance.Empty.Options.UseBackColor = true;
tree.Appearance.Row.BackColor = System.Drawing.Color.WhiteSmoke;
tree.Appearance.Row.Options.UseBackColor = true;
//Appearance.HideSelectionRow
tree.Appearance.HideSelectionRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
tree.Appearance.HideSelectionRow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
tree.Appearance.HideSelectionRow.Options.UseBackColor = true;
tree.Appearance.HideSelectionRow.Options.UseForeColor = true;
//Appearance.SelectedRow
tree.Appearance.SelectedRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
tree.Appearance.SelectedRow.ForeColor = System.Drawing.Color.Red;
tree.Appearance.SelectedRow.Options.UseBackColor = true;
tree.Appearance.SelectedRow.Options.UseForeColor = true;
//Options
tree.OptionsBehavior.Editable = false;
tree.OptionsSelection.EnableAppearanceFocusedCell = false;
tree.OptionsView.ShowHorzLines = false;
tree.OptionsView.ShowVertLines = false;
tree.TreeLineStyle = DevExpress.XtraTreeList.LineStyle.Percent50;
tree.OptionsView.ShowRoot = true;
tree.LookAndFeel.UseDefaultLookAndFeel = false;
tree.LookAndFeel.UseWindowsXPTheme = true;
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
扫一扫加微信
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网