DevStyle.SetTreeListSelectStyle 设置TreeList组件只读状态(用于选择)
作者:C/S框架网|www.cscode.ne  发布日期:2021-06-03 16:33:22
  DevStyle.SetTreeListSelectStyle 设置TreeList组件只读状态(用于选择)

贴图图片-treelistlookupedit




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




C/S框架网|原创精神.创造价值.打造精品

扫一扫加微信
C/S框架网作者微信 C/S框架网|原创作品.质量保障.竭诚为您服务

上一篇 下一篇