// Use this for initialization public UIMarquee() { instance = this; }
public FrmDemo() { InitializeComponent(); image = new UIImage(); image.Dock = DockStyle.Right; image.Width = 400; this.UIControls.Add(image); // line = new UILine(); line.Location = new Point(300, 270); line.Size = new Size(500, 50); line.LineBlendStyle = BlendStyle.FadeInFadeOut; line.LineWidth = 2; line.LineDashStyle = DashStyle.Dash; this.UIControls.Add(line); // label = new UILabel(); label.Location = new Point(250, 200); label.Size = new Size(100, 50); label.Font = new Font("微软雅黑", 13f); label.Text = "测试文本测试文本测试文本测试文本测试文本"; this.UIControls.Add(label); // progress = new UIProgress(); progress.Location = new Point(300, 200); progress.Percentage = 20; progress.Size = new Size(600, 50); progress.Anchor = AnchorStyles.None; this.UIControls.Add(progress); // btnOut = new UIButton(); btnOut.Size = new Size(300, 100); btnOut.Location = new Point(10, 20); btnOut.Dock = DockStyle.None; btnOut.UIParent = this; btnOut.Name = "out"; btnOut.Text = btnOut.Name; btnOut.Font = new Font(btnOut.Font.FontFamily, 45f); btnOut.TextRenderingHint = TextRenderingHint.AntiAlias; btnOut.Click += (sender, e) => Console.WriteLine("单击out"); this.UIControls.Add(btnOut); // btnInner2 = new UIButton(); btnInner2.Size = new Size(50, 20); btnInner2.Location = new Point(55, 55); btnInner2.UIParent = this.btnOut; btnInner2.Name = "in2"; btnInner2.Text = btnInner2.Name; btnInner2.Click += (sender, e) => MessageBox.Show("单击in2"); this.btnOut.UIControls.Add(btnInner2); // btnInner = new UIButton(); btnInner.Size = new Size(50, 20); btnInner.Location = new Point(5, 15); btnInner.UIParent = this.btnOut; btnInner.Name = "in"; btnInner.Text = btnInner.Name; btnInner.Click += (sender, e) => Console.WriteLine("单击in"); this.btnOut.UIControls.Add(btnInner); // marquee = new UIMarquee(); marquee.Size = new Size(801, 4); marquee.Location = new Point(100, 200); marquee.BorderColor = Color.Transparent; this.marquee.BackColor = Color.Transparent; marquee.Dock = DockStyle.Bottom; marquee.ProgressColor = Color.DodgerBlue; this.UIControls.Add(this.marquee); this.marquee.SendToBack(); // link = new UILink(); link.Size = new Size(40, 15); link.Location = new Point(500, 10); this.link.Font = new Font("微软雅黑", 10f, GraphicsUnit.Point); link.Text = "换一张"; this.UIControls.Add(this.link); // link2 = new UILink(); link2.Size = new Size(40, 15); link2.Location = new Point(540, 10); link2.Text = "换一张"; this.UIControls.Add(this.link2); }