|
} } public string labelString { get { return label.Text; } set { label.Text = value; } } public string textString { get { return textBox.Text; } set { textBox.Text = value; } } 6、 这一步需要重写 CreateChildControls() 方法,该方法会自动被调用,用来生成子控件。 protected override void CreateChildControls() { this.EnsureChildControls();//如果子控件没有创建,则创建 base.CreateChildControls ();//调用方法 CreateControls(); } 7、 将第一步的脚本存到一个常量中: private const string MOUSE_SCRIPT = //用来触发鼠标事件的脚本 "<script language=javascript>\n" + "var OldColor;\n" + "function ltmouseover(ctrl,color)\n" + //当鼠标移入时,调用该方法,ctrl为表格,color为要改变的颜色值 "{\n" + "OldColor = ctrl.style.backgroundColor;\n" + //记录下原来的文档背景颜色 "ctrl.style.color = ''''#ffffff'''';\n" +//将字体颜色改为白色 "ctrl.style.backgroundColor = color;\n" + //更改表格背景颜色 "}\n" + "function ltmouseout(ctrl)\n" + //鼠标移出时调用 ,参数同上 "{\n" + "ctrl.style.backgroundColor = OldColor;\n" + //还原背景颜色 "ctrl.style.color = ''''#000000'''';" + //将字体颜色还原成黑色 "}\n" + 上一页 [1] [2] [3] [4] [5] 下一页 [C语言系列]NET 中C#的switch语句的语法 [系统软件]托拽Explore中的文件到VB.net的窗口 [系统软件]Boost库在XP+Visual C++.net中的安装 [系统软件]交叉编译sshd for IXP425 ARM Platform by MVL 3… [常用软件]新配色面板:Paint.Net3.0RC1官方下载 [常用软件]用内建的“Net Meeting”聊天 [VB.NET程序]Henry的VB.NET之旅(三)—共享成员 [VB.NET程序]Henry的VB.NET之旅(二)—构造与析构 [VB.NET程序]Henry的VB.NET之旅(一)—失踪的窗体 [VB.NET程序]在托盘上显示Balloon Tooltip(VB.NET)
|