简体   繁体   中英

C#/WPF - Picturebox like control?

Does a picturebox like control exist in WPF? I want a control that I can easily change/retrieve the backcolor of.

Image is the class you are looking for. The name may be confusing, but it is a control. Also, everything in WPF can be customized. The background color of every control can be changed.

You can use rectangle control & set the Fill property with the respective color. For click event, you can add MouseDownEvent handler to rectangle.

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