简体   繁体   中英

How can I use images for switch button in C#

Please, can you help me how can I change the button image to another on Mouse-over.

This is base button style

基本按钮

This is mouseover button style:

http://imgur.com/iDrzKOg

I really thanks for every answers which can help me.

您只需将MouseHover事件附加到按钮,然后在事件内部将按钮BackgroundImage属性设置为悬停图像。

Submit button:

  <input type="image" title="" class="myclass" src="http://i.imgur.com/qNRRTgN.png" /> 

CSS:

.myclass:hover {
background: url(http://i.imgur.com/iDrzKOg.png)  no-repeat; border: none;
}

Working Fiddle

 <img id="img1" runat="server" src="images/image1.jpg" 
        onmouseover="src='images/image1_over.jpg'"
        onmouseout="src='images/image1.jpg'"  />

you can use this... this is the simplest one

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM