I am trying to create an application with WinForms .NET 5.0 C#.
I have a panel in which, five buttons appear above the other controls(buttons, labels etc.) when button A
is clicked. What I want is to make the user only focus on those 5 five buttons. And for that I need to make the rest of the controls in the panel and the panel itself a little darker.
One solution to this is that I can make the Back Color of those controls a little darker, but for that I am not able to find the right RGB values or the right color.
I also tried these steps to do so -
- Add the buttons and their code in a separate child form
- Make the child form black and reduce the child form's opacity(to make it a little transparent)
- Add the child form in the panel when the button is clicked
Expectations: I expected that since the child form's color is black and opacity is low, it would automatically create a dark background and highlight the buttons
Reality: When I clicked the button the child form appeared and also showed the buttons, but it was opaque and it hid the other controls beneath it(yes I used BringToFront()
method).
So, could there be any other solution to this or am I missing something here?
EDIT
Here I did it manually with the help of 2 forms just for the sake of demo(one has low opacity). You can see that the background is dark. You can also see that the link label
is slightly visible through the button(which I don't want). I want that only the background should be dark(and the button should be opaque) that's why I am not using another child form with it and there's one more reason why I am not using the child form(see above steps which I tried).
I can see only two options - Either make the controls behind it dark or follow your answers.
For making the controls dark, I need to handle the RGB values which I am not able to.
I hope now you know what I mean...