Solved

PictureBox Selection?

Posted on 2004-10-21
296 Views
Last Modified: 2008-02-01
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?
0
Question by:DragXSlay
    4 Comments
     
    LVL 18

    Assisted Solution

    by:armoghan
    One way could be to use Buttons instead of PictureBoxes. It can be shown selected easily. and on focus the image can also change
    0
     
    LVL 18

    Expert Comment

    by:armoghan
    0
     
    LVL 20

    Assisted Solution

    by:TheAvenger
    Change the BorderStyle property of the picture boxes. E.g. None for not selected and FixedSingle for selected
    0
     
    LVL 4

    Accepted Solution

    by:
    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

    <Farshid/>
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Live - One-on-One C# Help from Top Experts

    Solve your toughest problems, fast.
    C# experts are online now and ready to help you.

    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    845 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    3 Experts available now in Live!

    Get 1:1 Help Now