雷火电竞-中国电竞赛事及体育赛事平台

歡迎來到入門教程網(wǎng)!

C#教程

當(dāng)前位置:主頁 > 軟件編程 > C#教程 >

DevExpress TreeList 常見問題解決方法

來源:本站原創(chuàng)|時間:2020-01-10|欄目:C#教程|點擊:

1、 如何給節(jié)點添加圖片? 首先需要添加一個圖片控件,然后給它加入圖片,最后把TreeList的節(jié)點圖片屬性和圖片控件綁定,代碼如下:

ImageList imagelist;
private void 測試窗口_Load(object sender, EventArgs e) 
{
con.ConnectionString = sqlconstr; 
DataTable dt = new DataTable; 
dt.Columns.Add("進(jìn)程");
dt.Rows.Add("123");
treeList1.Dock = DockStyle.Fill;
treeList1.DataSource = dt; 
imagelist = new ImageList; 
imagelist.Images.Add(Image.FromFile(@"E:\圖片素材\2.jpg")); 
treeList1.SelectImageList = imagelist; 
treeList1.Nodes[0].ImageIndex = 0;
}

2、 如何將背景色設(shè)為透明?

treeList1.BackColor = Color.Transparent; 
treeList1.Appearance.Empty.BackColor = Color.Transparent; 
treeList1.Appearance.Row.BackColor = Color.Transparent;

3、 如何展開當(dāng)前節(jié)點和父節(jié)點?

/// <summary>
/// 展開當(dāng)前節(jié)點及父節(jié)點
/// </summary>
/// <param name="_node">
public void ParentNodeExpend(TreeListNode _node)
{
  TreeListNode _cNode = _node;
  treeList1..Nodes.TreeList.FindNodeByID(_cNode.Id).Expanded = true;

4、 如何設(shè)置顯示水平滾動條?

public void TreeListHorzScroll(TreeList treeList)
{
treeList.OptionsView.AutoWidth = false;

下面看下DevExpress常見問題解決方案

layoutControl:

   1.lookAndFeel。

   2.OptionsView 之 AllowHotTrack【鼠標(biāo)放上去變色】,DrawItemBorders【控件邊框是否顯示】

   3.BeginInvoke(new MethodInvoker(delegate { textEdit1.Focus()})); 【獲取焦點】

   4.layoutControl1.OptionsItemText.TextAlignMode=AlignInLayoutControl.(設(shè)置拖放控件后,控件自動跟原有內(nèi)容調(diào)整)查看圖片

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

GridView :

  1.屬性 IndicatorWidth, 設(shè)置GirdView最左端列寬度【自動生成列,跟綁定的數(shù)據(jù)列沒有關(guān)系】。

  2.禁用每個列排序,      this.gridView1.OptionsCustomization.AllowSort = false;

 ---------------------------------------------------------------------------------------
 ---------------------------------------------------------------------------------------

TreeList:

1.每個列禁用排序,設(shè)置每個列的 OptionsColumn.AllowSort = false,在Run Designer每個列中都可看到該屬性;

DateEdit:

1、禁用鼠標(biāo)滾動。      

dateEdit1.Spin += new DevExpress.XtraEditors.Controls.SpinEventHandler(dateEdit1_Spin);
     void dateEdit1_Spin(object sender, DevExpress.XtraEditors.Controls.SpinEventArgs e)
     {
      e.Handled = true;
     }

以上所述是小編給大家介紹的DevExpress TreeList 常見問題解決方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對我們網(wǎng)站的支持!

上一篇:Devexpress treelist 簡介

欄    目:C#教程

下一篇:詳解C#中SqlParameter的作用與用法

本文標(biāo)題:DevExpress TreeList 常見問題解決方法

本文地址:http://m.jygsgssxh.com/a1/C_jiaocheng/6051.html

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有