Web自定义控件FlashLabelusing System;
Web自定义控件FlashLabel
using System.Web.UI;
Web自定义控件FlashLabel
using System.Web.UI.WebControls;
Web自定义控件FlashLabel
using System.ComponentModel;
Web自定义控件FlashLabel
namespace Hover.WebControls
{

Web自定义控件FlashLabel    
/// FlashLabel 的摘要说明。
Web自定义控件FlashLabel    
/// Description:文字闪烁的Label控件
Web自定义控件FlashLabel    
/// WebSite:IT动力营 Http://ITHero.NET 
Web自定义控件FlashLabel    
/// Author:翱翔.Net(Hover)
Web自定义控件FlashLabel    
/// Email:zytp@163.com
Web自定义控件FlashLabel    
/// MSN:Zytp@MSN.Com
Web自定义控件FlashLabel    
/// Blog:Http://CnBlogs.Com/Hover
Web自定义控件FlashLabel    
/// </summary>
Web自定义控件FlashLabel    [DefaultProperty("Text"), 
Web自定义控件FlashLabel    ToolboxData(
"<{0}:FlashLabel runat=server ></{0}:FlashLabel>")]
Web自定义控件FlashLabel    
public class FlashLabel : System.Web.UI.WebControls.Label
{
Web自定义控件FlashLabel        
private int flashSpeed=100;
Web自定义控件FlashLabel        [Bindable(
true), 
Web自定义控件FlashLabel        Category(
"Appearance"), 
Web自定义控件FlashLabel        DefaultValue(
""),
Web自定义控件FlashLabel        Description(
"文字闪烁速度!")] 
Web自定义控件FlashLabel            
Web自定义控件FlashLabel        
public int FlashSpeed
{
Web自定义控件FlashLabel            
get
{
Web自定义控件FlashLabel                
return flashSpeed;
Web自定义控件FlashLabel            }

Web自定义控件FlashLabel
Web自定义控件FlashLabel            
set
{
Web自定义控件FlashLabel                flashSpeed
=value;
Web自定义控件FlashLabel            }

Web自定义控件FlashLabel        }

Web自定义控件FlashLabel        
Web自定义控件FlashLabel
 
Web自定义控件FlashLabel        
/// 将此控件呈现给指定的输出参数。
Web自定义控件FlashLabel        
/// </summary>
Web自定义控件FlashLabel        
/// <param name="output"> 要写出到的 HTML 编写器 </param>
Web自定义控件FlashLabel        protected override void Render(HtmlTextWriter output)
{
Web自定义控件FlashLabel            
string s;
Web自定义控件FlashLabel            
string scriptString="<script language=JavaScript> \n";
Web自定义控件FlashLabel            scriptString
+="function glowit(which){ \n"
Web自定义控件FlashLabel            scriptString
+="if (document.all.glowtext.filters[0].strength==2) \n ";
Web自定义控件FlashLabel            scriptString
+="document.all.glowtext.filters[0].strength=1 \n";
Web自定义控件FlashLabel            scriptString
+="else  \n";
Web自定义控件FlashLabel            scriptString
+="document.all.glowtext.filters[0].strength=2 } \n";
Web自定义控件FlashLabel            scriptString
+="function startglowing(){ \n";
Web自定义控件FlashLabel            scriptString
+="var fp='"+this.FlashSpeed+"'; \n";
Web自定义控件FlashLabel            scriptString
+=@"setInterval(""glowit(0)"",fp)}";            
Web自定义控件FlashLabel            scriptString
+=" \n window.onload=startglowing \n";
Web自定义控件FlashLabel            scriptString
+="</script>";
);
Web自定义控件FlashLabel            output.Write(scriptString);
Web自定义控件FlashLabel            output.Write(s);
Web自定义控件FlashLabel        }

Web自定义控件FlashLabel    }

Web自定义控件FlashLabel}

Web自定义控件FlashLabel

相关文章: