张银的博客


Eat to live, but do not live to eat.

导航

按钮(Button)

Posted on 2009-01-14 16:12  张银  阅读(328)  评论(0编辑  收藏  举报

<asp:Button ID="Button1" runat="server" Text="按钮" Width="250px" 
onmouseover="c=this.style.backgroundColor;this.style.backgroundColor='#00ff99';this.style.width='350';" 
onmouseout
="this.style.backgroundColor=c;this.style.width='250';" Font-Bold="True" 
Font-Names
="楷体_GB2312" Font-Size="22pt" ForeColor="#400000" Height="44px" />

补充按钮字体粗细this.style.fontWeight='bold或者normal'

多个按钮的单击响应同一事件,这几个按钮的CommandName(发泡)是不同的

protected void Button3_Click(object sender, EventArgs e)
{
 
switch ( ((Button)sender).CommandName ) //用到了事件的委托??
 {
  
case "a":
  

 }
}