c# winform及DotnetBar筆記

來源:互聯網
上載者:User
1.DataGridView 格式化顯示cell裡的資料日期等。
進入編輯列,選擇要設定的列,DefaultCellStyle裡->行為->formart設定

2.tabstrip和mdi視窗的結合使用給MDI視窗加上TabPage。
拖動個tabstrip到MDI視窗上tabstrip裡選擇到主視窗名就加上TABPAGE了。dock要設定成top。但子mdi視窗在第一次開啟的時候上面一截沒現實出來,相當於tabpage高度一截遮擋了mdi視窗內容,但第二次開啟mdi視窗就好了。解決,將mdi support->mdiautohide設定為false就ok了。
 

3.DevComponents.DotNetBar.TabControl動態添加Tab
這個和系統的TabPage不同,一個TabPage分為了DevComponents.DotNetBar.TabItem,DevComponents.DotNetBar.TabControlPanel兩個部分。最簡單的添加tab和pannels的辦法是用TabControl.CreateTab方法,然後將返回TabItem對象,這樣就可以用TabItem.AttachedControl方法來訪問這個tab的pannel。在這個pannel上你可以使用像TabItem.AttachedControl.Controls.Add(myControl)這樣的方法

代碼:TabItem tim = this.tabControl1.CreateTab("一個Tab");
Label lblTest = new Label();
lblTest.Text = "wawawa";
tim.AttachedControl.Controls.Add(lblTest);

這看到的方法:http://www.devcomponents.com/kb/questions.php?questionid=45

 

 

 

 

 

設定dotnetbar主題為黑色black

 

1.繼承public partial class Form1 : DevComponents.DotNetBar.Office2007RibbonForm

 

2.引用

using DevComponents.DotNetBar;
using DevComponents.DotNetBar.Rendering;

 

3.頁面中放入一個RibbonControl

 

4.設定該控制項

this.ribbonControl1.Office2007ColorTable = DevComponents.DotNetBar.Rendering.eOffice2007ColorScheme.Black;

該句可放到desingner.cs InitializeComponent()裡。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.