亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

給ListBox添加雙擊事件示例代碼

 更新時(shí)間:2013年12月02日 17:05:58   作者:  
如何給ListBox添加雙擊事件,想必有很多的新手朋友們都不會(huì)吧,下面有個(gè)不錯(cuò)的示例,感興趣的朋友可以參考下
復(fù)制代碼 代碼如下:

<!--創(chuàng)建一個(gè)JS調(diào)用button的click事件-->
<script type="text/javascript">
function JsListChangeItem() {

document.getElementById("buttonShow").click();
}
</script>
<!--創(chuàng)建一個(gè)隱藏的button,創(chuàng)建雙擊事件--->
<asp:Button ID="buttonShow" runat="server" onclick="buttonShow_Click" Text="Button" style="display:none"/>

<!--實(shí)現(xiàn)雙擊的listbox-->
<asp:ListBox ID="listBox1" runat="server"Height="226px" Width="211px" AutoPostBack="True"></asp:ListBox>

.cs
復(fù)制代碼 代碼如下:

protected void Page_Load(object sender, EventArgs e)
{
listBox1.Attributes.Add("ondblclick", "JsListChangeItem()");//為listBox1添加雙擊事件。
}

相關(guān)文章

最新評論