コード例 #1
0
        private void UcNavBar_Paint(object sender, PaintEventArgs e)
        {
            UcPicButtomEx zsmpictbnt = null;
            int           num;

            for (num = 0; num < base.Controls.Count; num++)
            {
                zsmpictbnt = (UcPicButtomEx)base.Controls[num];
                if (zsmpictbnt.type == 1)
                {
                    if (zsmpictbnt.barindex > this.actbarindex)
                    {
                        break;
                    }
                    zsmpictbnt.Top = this._barH * (zsmpictbnt.barindex - 1);
                }
            }

            for (num = base.Controls.Count - 1; num > 0; num--)
            {
                zsmpictbnt = (UcPicButtomEx)base.Controls[num];
                if (zsmpictbnt.type == 1)
                {
                    if (zsmpictbnt.barindex <= this.actbarindex)
                    {
                        break;
                    }
                    zsmpictbnt.Top = base.Height - (((this.barmaxID - zsmpictbnt.barindex) + 1) * this._barH);
                }
            }
        }
コード例 #2
0
 public void Addbar(UcPicButtomEx bar)
 {
     this.barmaxID++;
     bar.barindex = this.barmaxID;
     bar.type     = 1;
     bar.Click   += new EventHandler(this.bar_Click);
     base.Controls.Add(bar);
 }
コード例 #3
0
 public void Addbnt(int _barindex, UcPicButtomEx bnt)
 {
     this.bntmaxID++;
     bnt.bntindex = this.bntmaxID;
     bnt.barindex = _barindex;
     bnt.type     = 0;
     bnt.Click   += new EventHandler(this.bnt_Click);
     base.Controls.Add(bnt);
 }
コード例 #4
0
        private void bar_Click(object sender, EventArgs e)
        {
            UcPicButtomEx zsmpictbnt = (UcPicButtomEx)sender;

            if ((zsmpictbnt.type == 1) && (this.actbarindex != zsmpictbnt.barindex))
            {
                this.actbarindex = zsmpictbnt.barindex;
                this.topcount    = 0;
                this.setscroll();
            }
        }
コード例 #5
0
        public UcPicButtomEx Addbar(string _name, string _text, int _imgindex)
        {
            UcPicButtomEx zsmpictbnt = new UcPicButtomEx();

            zsmpictbnt.Visible = true;
            zsmpictbnt.Name    = _name;
            zsmpictbnt.BntText = _text;
            this.barmaxID++;
            zsmpictbnt.barindex = this.barmaxID;
            zsmpictbnt.type     = 1;
            zsmpictbnt.Click   += new EventHandler(this.bar_Click);
            base.Controls.Add(zsmpictbnt);
            return(zsmpictbnt);
        }
コード例 #6
0
 public void setscroll()
 {
     if (this.barmaxID > 0)
     {
         UcPicButtomEx zsmpictbnt = null;
         int           num        = (this.actbarindex * this._barH) - (this.topcount * (this._bntH + this._bntJL));
         int           num2       = 0;
         int           num3       = 0;
         for (int i = 0; i < base.Controls.Count; i++)
         {
             zsmpictbnt = (UcPicButtomEx)base.Controls[i];
             if ((zsmpictbnt.type == 0) && zsmpictbnt.Visible)
             {
                 num2++;
                 zsmpictbnt.Top = (num + (this._bntJL * num2)) + (this._bntH * (num2 - 1));
                 num3           = zsmpictbnt.Top + this._bntH;
             }
         }
         this.cmddown.Top  = (this.actbarindex * this._barH) + 5;
         this.cmddown.Left = (base.Width - this.cmddown.Width) - 10;
         if (this.topcount > 0)
         {
             this.cmddown.Visible = true;
         }
         else
         {
             this.cmddown.Visible = false;
         }
         int num5 = base.Height - ((this.barmaxID - this.actbarindex) * this._barH);
         this.cmdup.Left = (base.Width - this.cmdup.Width) - 10;
         this.cmdup.Top  = (num5 - 5) - this.cmdup.Height;
         if (num3 >= num5)
         {
             this.cmdup.Visible = true;
         }
         else
         {
             this.cmdup.Visible = false;
         }
     }
 }