code: protected void removeButtons (int start, int count)
      {
          while (count-- > 0) {
              remove(start);
          }
  
          // adjust the selected index
          if (_selectedIndex >= start) {
              if (start + count > _selectedIndex) {
                  _selectedIndex = -1;
              } else {
                  _selectedIndex -= count;
              }
          }
      }
docs: Removes the buttons in the specified interval.