扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:廖煜嵘编译 来源:yesky 2007年11月8日
关键字: Windows
line 1: private Color _colOff; line 2: [Category( "Appearance" ), Description( "The background color when the control loses focus" )] line 3: public Color BackColorOff line 4: { line 5: get{return _colOff;} line 6: set{_colOff = value line 7: } line 8: private Color _colOn; line 9: [Category( "Appearance" ), Description( "The background color when the control has the focus" )] line 10: public Color BackColorOn line 11: { line 12: get{return _colOn; } line 13: set{_colOn = value;} line 14: } |
line 1: protected override void AddAttributesToRender( HtmlTextWriter writer ) line 2: { line 3: base.AddAttributesToRender( writer ); line 4: //only add the client-side javascript for design mode or IE line 5: if( inDesignMode() || System.Web.HttpContext.Current.Request.Browser.Type.IndexOf( "IE" ) > -1 ) line 6: { line 7: writer.AddAttribute( "onFocus", "JavaScript:this.style.backgroundColor='" + ColorTranslator.ToHtml( _colOn ) + "';" ); line 8: if( _colOff.Equals( Color.Empty ) ) line 9: { line 10: _colOff = this.BackColor; line 11: } line 12: writer.AddAttribute( "onBlur", "JavaScript:this.style.backgroundColor='" + ColorTranslator.ToHtml( colOff ) + "';" ); line 13: } line 14: } |
line 1: private bool inDesignMode() line 2: { line 3: bool blnOut = false; line 4: if( object.ReferenceEquals( System.Web.HttpContext.Current, null ) ) line 5: { line 6: blnOut = true; line 7: } line 8: else line 9: { line 10: blnOut = false; line 11: } line 12: return blnOut; line 13: } |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者