moevi
moevi

Reputation: 105

C# Volume mixer like buttons/combo boxes

How would you get a button to look and perform similar to that of the buttons in the volume mixer on Win7?

What I mean is that in the volume mixer there are icons that doesn't look like buttons until you hover them, they also haven't got the standard blueish color when hovered.

So far I haven't found a way to do this directly in visual studio. I'm guessing that creating a custom user control is the only way to go, but I've had no luck so far, I would appreciate some examples.

In addition, there are also combo boxes in the volume mixer I would like to duplicate. They're hidden except for the text and arrow until they're hovered.

Is there a way to accomplish this?

(Here an image that might help explain what I mean: http://i53.tinypic.com/2ij409u.png)

Upvotes: 1

Views: 773

Answers (3)

26071986
26071986

Reputation: 2330

There is quite a terrific solution for this button quest. You can paste pictureBoxes on form and handle MouseUp, MouseLeft and MouseDown events. When each of them fires, you need to set specific image (one of tree, in fact) - normal picture, picture of "highlighted" icon and picture of pressed icon. But that's really a hard and useless work, so better don't.

If you need several of such "buttons" in a panel, I remember, I once managed to get the same behaviour by using toolStrip with buttons.

Upvotes: 0

xandy
xandy

Reputation: 27421

For windows application, (and also how they did win7), they used the technology called WPF. I am not specifically answering how you can do this, because in WPF, this is the fundamental that defining skin (via markup called XAML) without touching the implementation code. If you are serious in learning how to do that, I suggest you look for tutorials or good book about WPF.

Here's one of the markup looks like for a button. To modify the button's look, what you need is to define it's XAML, and you don't have to inherit it in the code. The example looks scary long, but Visual Studio could help you.

Upvotes: 1

Rohan West
Rohan West

Reputation: 9298

You could use a third party control library, for example Krypton Toolkit, its free!

Upvotes: 0

Related Questions