按鈕動畫 定時響應重新整理

2022-06-20 15:33:13 字數 1858 閱讀 6444

效果圖如下:

新建使用者控制項uc_autorefreshbutton

後台實現

public partial class uc_autorefreshbutton : usercontrol

set

}public static readonly dependencyproperty imgbackgroudpathproperty =

dependencyproperty.register("imgbackgroudpath", typeof(string), typeof(uc_autorefreshbutton), new propertymetadata(valueboxes.stringemptybox));

/// /// 動畫持續時間(s)

///

public int aminationduration

set

}public static readonly dependencyproperty aminationdurationproperty =

dependencyproperty.register("aminationduration", typeof(int), typeof(uc_autorefreshbutton), new propertymetadata(1));

/// /// 宣告路由事件

/// 引數:要註冊的路由事件名稱,路由事件的路由策略,事件處理程式的委託型別(可自定義),路由事件的所有者型別

///

public static readonly routedevent clickedevent = eventmanager.registerroutedevent("clicked", routingstrategy.bubble, typeof(routedeventhandler), typeof(uc_autorefreshbutton));

/// /// 處理各種路由事件的方法

///

public event routedeventhandler clicked

// 從路由事件處理程式中移除路由事件

remove

}storyboard _storyboard;

public uc_autorefreshbutton()

private void usercontrol_loaded(object sender, routedeventargs e)

void storyboardstart()

}private void _storyboard_completed(object sender, eventargs e)

private void usercontrol_unloaded(object sender, routedeventargs e)

private void button_click(object sender, routedeventargs e)

}

應用:

private void ucrefresh_clicked(object sender, routedeventargs e)

m......

iOS定時重新整理按鈕的文字,避免按鈕閃爍的辦法

今天做乙個功能,一開始將某按鈕置灰,然後倒計時60秒。每秒鐘都重新整理按鈕的文字,倒計時結束後,使按鈕可用。很快就做好了,不過發現乙個問題,就是按鈕會閃爍,跟星星似的。我的 是 countdown 60 uicolor color self.cansend uicolor colorwithred ...

重新整理按鈕 1

將它的值預設設定在介面上,重新整理時使用s 獲取查詢引數 string lineid request.getparameter productline string familyid request.getparameter productfamily string productid reques...

java按鈕響應

要讓類c的物件響應按鈕btn的單擊訊號,需要讓c實現actionlistener介面,類宣告 public class c implements actionlistener 類c中要實現actionperformed方法 public void actionperformed actioneven...