Sign in to follow this  
Zeddan

[.net] Border around button at selection

Recommended Posts

Hi there! I am working on a Mastermind game currently and need to implement functionality for displaying an explicit graphical "boundary" around a button when it is selected and removing the boundary when the button is deselected. I also would like to be able to use the buttons that have been selected in the game while excluding those that are not selected. That is, the user should be able to choose which colors that are to be used for each instance of the game. Do you have any suggestions on what I can do to solve this problem without using global variables? Thanks in advance!

Share this post


Link to post
Share on other sites
First part.


button1.FlatStyle = FlatStyle.Flat;

private void button1_Click(object sender, EventArgs e)
{

if (button1.FlatAppearance.BorderSize < 2)
{
button1.FlatAppearance.BorderSize = 3;
}
else
{
button1.FlatAppearance.BorderSize = 1;
}
}



The form should be able to handle the button section things.

theTroll

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this