天天看點

DevExpress.XtraEditors.DataNavigator用法 DataNavigator Class

1、devexpress.xtraeditors.datanavigator剛拖到winform窗體上的樣子:

DevExpress.XtraEditors.DataNavigator用法 DataNavigator Class

設定datanavigator控件屬性dock=bottom;textlocation=end;textstringformat=第 {0}頁 ,共 {1}頁;

如果想顯示tooltip,需把showtooltips設定為true.設定button的hint為自己想要顯示的内容即可。

比如:

DevExpress.XtraEditors.DataNavigator用法 DataNavigator Class

在運作時會有下面效果:

DevExpress.XtraEditors.DataNavigator用法 DataNavigator Class

上圖中的首頁、前一頁、後一頁、尾頁的圖檔是自定義的,那麼怎麼使用自定義圖檔呢?

拖拽一個imagelist控件,然後在imagelist中選擇要使用的自定義圖檔

DevExpress.XtraEditors.DataNavigator用法 DataNavigator Class

然後在buttons頁籤下将imagelist設定為剛才選擇過圖檔的imagelist1控件,然後在datanavigator控件

buttons下選擇荼盤即可,比如下圖的first

DevExpress.XtraEditors.DataNavigator用法 DataNavigator Class

按鈕事件處理:

dev官方文檔:

the control that enables navigation through records in a data source and provides common record operations.

assembly:devexpress.xtraeditors.v14.2.dll

c#

vb

the datanavigator control is used to navigate through

and so it inherits properties and methods common to all data navigation controls.

the data navigator displays built-in buttons that enable a user to scroll forward or backward through records one at a time, go to the first record, go to the last record, insert a new record,

the datanavigator control needs to be associated

for binding.

the datanavigator can display a text string that specifies the current record and the total record count in the associated

customize the display of this text.