• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 346
  • Last Modified:

PictureBox Selection?

I'm working on a card program that gives the user the ability to select different decks.  I'm going to display the decks using pictureboxes.  I would like it so that when a user clicks on a deck, there is some form of outline so they know which deck is currently selected.  Then, based on that selection, when they click OK, it passes a variable back to the original form to indicate which deck was selected.  Does anyone know an easy way to do this or can it only be done using a radio button?
  • 2
3 Solutions
One way could be to use Buttons instead of PictureBoxes. It can be shown selected easily. and on focus the image can also change
Change the BorderStyle property of the picture boxes. E.g. None for not selected and FixedSingle for selected
First, you should programmatically provide the behavious of Radio Button Group to your cards group. It's your own job!
Second, as TheAvenger said, you can use the followind code:

pictureBox.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
pictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;// Or None

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now