How to create a Switch on / off button in c #

0

I am trying to create a swtich on / off for a desktop opalance in C # but I do not find any recent documentation of this, only half-finished documents or the examples I have tried have not worked

Currently I'm trying to control the Checbox by changing its appearance to a button

 cbSound.Appearance = System.Windows.Forms.Appearance.Button;

But the final result is not so clear for the functionality, what I try is to look as similar as possible to the next image

Do you know any way to create it? Do you know any good documentation about it?

    
asked by Alejo Florez 04.10.2017 в 19:17
source

1 answer

1

If you already have the images, you could simulate the buttons with images using your MouseClick, MouseEnter, MouseLeave and down events, changing the image in each one of them

boton.Source= new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/Resources/imagen1.png")));
    
answered by 04.10.2017 / 19:32
source