using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using DevExpress.XtraEditors; namespace HDSafetyClient.UserControls { public partial class UCPage : DevExpress.XtraEditors.XtraUserControl { public UCPage() { InitializeComponent(); } private void UCPage_Load(object sender, EventArgs e) { } public delegate void PageDownHandler(); public event PageDownHandler onPageDown; public delegate void PageUpHandler(); public event PageUpHandler onPageUp; public delegate void PageGoFirstHandler(); public event PageGoFirstHandler onPageGoFirst; public delegate void PageGoLastHandler(); public event PageGoLastHandler onPageGoLast; int pageCount = 0; /// <summary> /// 总页码数 /// </summary> public int PageCount { get { return pageCount; } set { pageCount = value; } } int curPage = 1; /// <summary> /// 当前页码数 /// </summary> public int CurPage { get { return curPage; } set { curPage = value; this.labelControl3.Text = CurPage "/" PageCount; } } //首页 private void simpleButton6_Click(object sender, EventArgs e) { if (onPageGoFirst != null) { onPageGoFirst(); } } //上一页 private void simpleButton7_Click(object sender, EventArgs e) { if (onPageUp != null) { onPageUp(); } } //下一页 private void simpleButton8_Click(object sender, EventArgs e) { if (onPageDown != null) { onPageDown(); } } //尾页 private void simpleButton9_Click(object sender, EventArgs e) { if (onPageGoLast != null) { onPageGoLast(); } } } }