⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rainbowlabel2.cs

📁 Professional C# 2nd Edition
💻 CS
字号:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace PCSCustomWebControls
{
	/// <summary>
	/// Summary description for RainbowLabel2.
	/// </summary>
	public class RainbowLabel2 : System.Web.UI.WebControls.WebControl, INamingContainer
	{
		private RainbowLabel rainbowLabel = new RainbowLabel();
		private Button cycleButton = new Button();

		public RainbowLabel2()
		{
			//
			// TODO: Add constructor logic here
			//
		}

		protected override void CreateChildControls()
		{
			cycleButton.Text = "Cycle colors.";
			cycleButton.Click += new System.EventHandler(cycleButton_Click);
			Controls.Add(cycleButton);
			Controls.Add(rainbowLabel);
			base.CreateChildControls();
		}

		protected void cycleButton_Click(object sender, System.EventArgs e)
		{
			rainbowLabel.Cycle();
		}

		public string Text
		{
			get
			{
				return rainbowLabel.Text;
			}
			set
			{
				rainbowLabel.Text = value;
			}
		}

		protected override void Render(HtmlTextWriter output)
		{
			rainbowLabel.RenderControl(output);
			cycleButton.RenderControl(output);
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -