zoukankan      html  css  js  c++  java
  • Updown Control控件 分析

    1,该控件重点
            事件回传,数据回传(对不太明白数据回传的请看这里:ASP.NET 2.0服务器控件之处理回传数据 )
            (a).要实现数据回传就要实现接口:IPostBackDataHandler
            (b)要实现的方法如下:
            
    bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
            {
                
    string presentValue = this.Text;
                
    string postedValue = postCollection[HiddenID];

                
    // If two values don't match, then update the value.
                if (!presentValue.Equals(postedValue))
                {
                    
    this.Text = postedValue;
                    
    // Indicate the state of this control has changed.
                    return true;
                }

                
    // If there was no change in the data, then indicate that there is
                
    // no change in state by returning false.
                return false;
            }
    void IPostBackDataHandler.RaisePostDataChangedEvent()
            {
                OnValueChanged(EventArgs.Empty);
            }
    void OnValueChanged(EventArgs args)
            {
                
    // If the value has been changed, raise the event.
                if (ValueChanged != null)
                {
                    ValueChanged(
    this, args);
                }
            }
    2.界面如下
                  screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='点击在新窗口浏览图片\nCTRL+Mouse 滚轮可放大/缩小';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" height=138 src="http://www.codeproject.com/KB/user-controls/updowncontrol1/updowncontrol1.gif" width=214 onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口浏览图片\nCTRL+Mouse 滚轮可放大/缩小';}" border=0>
    3。代码下载
        下载

    欢迎大家加入 "小强控件园" ,有更多惊喜等着你,进入小强控件园
    工欲善其事,必先利其器

  • 相关阅读:
    android 圆角图片的实现
    navigationView 的使用和布局文件的绑定
    android listview 的监听事件
    android第三方框架 xlistview 的使用
    android Baseadapter 和 ViewHolder的使用
    android 调用电话功能
    android 颜色对照
    Android_menu_SubMenu
    Android_menu_optionMenu
    Android_Menu_contextMenu
  • 原文地址:https://www.cnblogs.com/HeroBeast/p/1044054.html
Copyright © 2011-2022 走看看