Beispiel #1
0
        void iScrollBar_MouseDown(object sender, MouseEventArgs e)
        {
            this.mousedownpoint = e.Location;
            if (e.Button == MouseButtons.Left)
            {
                if (this.ScrollType == iScrollType.Vertical)
                {
                    if (e.Location.Y < pbScroll.Location.Y)
                    {
                        this.isd = iScrollDirection.Up;
                    }
                    else
                    {
                        this.isd = iScrollDirection.Down;
                    }

                }
                else if (this.ScrollType == iScrollType.Horizontal)
                {
                    if (e.Location.X < pbScroll.Location.X)
                    {
                        this.isd = iScrollDirection.Left;
                    }
                    else
                    {
                        this.isd = iScrollDirection.Right;
                    }
                }
                this.tmDirection.Start();
            }
        }
Beispiel #2
0
 protected void pbDirection_MouseDown(object pbScroll, iScrollDirection direction)
 {
     switch (direction)
     {
         case iScrollDirection.Up:
             {
                 this.Value -= this._smallChange;
                 setpbScroll(0, (int)(scrolllength * ((float)_value / _maximum)) + arrowWidth);
                 break;
             }
         case iScrollDirection.Down:
             {
                 this.Value += this._smallChange;
                 setpbScroll(0, (int)(scrolllength * ((float)_value / _maximum)) + arrowWidth);
                 break;
             }
         case iScrollDirection.Left:
             {
                 this.Value -= this._smallChange;
                 setpbScroll((int)(scrolllength * ((float)_value / _maximum)) + arrowWidth, 0);
                 break;
             }
         case iScrollDirection.Right:
             {
                 this.Value += this._smallChange;
                 setpbScroll((int)(scrolllength * ((float)_value / _maximum)) + arrowWidth, 0);
                 break;
             }
     }
 }