---
title: "Button image background disappears when on hover"  
description: "Button image background disappears when on hover"  
author: "Anonymous User"  
published: 2013-12-23  
updated: 2019-04-03  
canonical: https://www.mindstick.com/forum/1838/button-image-background-disappears-when-on-hover  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Button image background disappears when on hover

When I create a [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) with a background and I hover over with my mouse, the [background image](https://www.mindstick.com/forum/539/css-background-image-properties-not-work-in-outlook) disappears. Is there a way to override or [cancel](https://answers.mindstick.com/qa/94501/how-can-i-cancel-my-singapore-flight-ticket) this [process](https://yourviews.mindstick.com/story/1525/7-important-factors-that-may-affect-the-learning-process)? I also read that I could set the image as [content](https://www.mindstick.com/articles/13019/get-the-best-content-marketing-pricing-packages-for-your-brand) of the button, however I couldn't get the [scaling](https://answers.mindstick.com/blog/33/database-sharding-a-practical-guide-to-scaling-modern-applications) [right](https://www.mindstick.com/articles/12766/check-whether-you-are-doing-digital-transformation-right-or-not) ([filling](https://yourviews.mindstick.com/audio/1303/the-power-of-silence-what-happens-when-you-stop-filling-every-moment) the button) programmatically. Thanks in advance.

## How I set the background:

```
BitmapImage bitmapImage = new BitmapImage(new Uri("http://www." + link + ".jpg"));videoButton.Background = new ImageBrush(){   ImageSource = bitmapImage};
```

## Replies

### Reply by Pravesh Singh

Hi Ezra,\

Try this code

```
        var brush =new ImageBrush();       
brush.ImageSource = new BitmapImage(new Uri("Images/myimage.png"));       
Button1.Background = brush;
```

I don’t think you set the [background](https://www.mindstick.com/articles/65/how-to-change-background-color-of-tab-control-in-c-sharp) properly.


---

Original Source: https://www.mindstick.com/forum/1838/button-image-background-disappears-when-on-hover

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
