C# Devexpress RibbonControl 在頂端後面空白處添加背景圖片
1、說明
本方法只適用於Devexpress 18.2 及其以上版本
低版本均只能自己畫
2、需求
在下圖紅色方框中添加圖片
3、屬性設置
3.1 首先添加一個新的PageGroup,並在其中添加一個PictureEdit
3.2 設置PageGroup相關屬性
將新建的PageGroup的屬性進行設置:
屬性 | 值 |
---|---|
Text | 設爲空 |
Alignment | Far |
AllowTextClipping | False |
ItemsLayout | OneRow |
3.2 設置PictureEdit屬性
屬性 | 值 |
---|---|
Caption | 設爲空 |
EditHeight | 200 |
EditWidth | 200 |
BorderStyle(在Edit裏面) | NoBorder |
3.3 當前界面
3.4 設置圖片
圖片設置需要使用代碼,這裏建議將圖片添加至資源文件
barEditItem1.EditValue = Properties.Resources.阿里巴巴;