public myProgressBar(fraMusicBox f, int x, int y, int w, int h) { //绘制进度条,用两个label以及一个picturebox组合为进度条 lblbottom = new Label(); lbltop = new Label(); lblbottom.BackColor = Color.Gray; lbltop.BackColor = Color.Yellow; //进度条上的光标 picFocus = new PictureBox(); picFocus.Size = new Size(12, 12); picFocus.Location = new Point(x + value, y - (6 - h / 2)); picFocus.BackgroundImage = Properties.Resources.yellowyuan; picFocus.BackgroundImageLayout = ImageLayout.Stretch; picFocus.BackColor = Color.Transparent; picFocus.BringToFront();//将控件放置所有控件最顶层 lblbottom.SetBounds(x, y, w, h); lbltop.Size = new Size(value, h); lblbottom.Controls.Add(lbltop); f.Controls.Add(picFocus); f.Controls.Add(lblbottom); x1 = x; y1 = y; h1 = h; w1 = w; f1 = f; }
public myLabel(string s, int x, int y, Panel p, fraMusicBox f) { myLabel m = this; this.s = s; this.x = x; this.y = y; this.p = p; this.f = f; m.MouseEnter += new EventHandler(m_MouseEnter); m.MouseLeave += new EventHandler(m_MouseLeave); m.MouseDoubleClick += new MouseEventHandler(m_MouseDoubleClick); }