13
2012
04

C# 根据当前页和总页数判断按钮是否可用

        /// <summary>
        /// 判断翻页按钮
        /// </summary>
        /// <param name="startpage">首页</param>
        /// <param name="uppage">上一页</param>
        /// <param name="downpage">下一页</param>
        /// <param name="lastpage">最后一页</param>
        /// <param name="CurrentPage">当前页</param>
        ///<param name="Pages">总页数</param>
        public void PageButton(Button startPage, Button upPage, Button downPage, Button lastPage, int CurrentPage, int pages)
        {
            if (CurrentPage > 1)
            {
                startPage.Enabled = true;
                upPage.Enabled = true;
            }
            else
            {
                startPage.Enabled = false;
                upPage.Enabled = false;
            }
            if (CurrentPage == pages)
            {
                downPage.Enabled = false;
                lastPage.Enabled = false;
            }
            else
            {
                downPage.Enabled = true;
                lastPage.Enabled = true;
            }
        }

« 上一篇下一篇 »

相关文章:

C# Winfrom中连接到其它的按钮  (2012-3-30 12:55:51)

JS check按钮的互斥  (2012-3-28 9:35:38)

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。