日期:2014-05-18 浏览次数:20614 次
        //找出要显示的最大索引和最小索引    
         int maxIndex=pageIndex;    
         int minIndex=pageIndex;    
         showPages--;                //去掉当前页    
         bool noOper;    
         while (showPages > 0)    
         {    
             noOper = true;    
             if (maxIndex + 1 < pageCount && showPages > 0)  //向前找一页    
             {    
                 maxIndex++;    
                 showPages--;    
                 noOper = false;    
             }    
             if (minIndex - 1 >= 0 && showPages > 0)    //向后找一页    
             {    
                 minIndex--;    
                 showPages--;    
                 noOper = false;    
             }    
             if (noOper)                        //没有查找,说明showPages>总页数    
                 break;    
         }