2022-11-15 14:22:17 -06:00

39 lines
1.1 KiB
C#
Executable File

namespace lab6_2_CalebFontenot
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void exitButton_Click(object sender, EventArgs e)
{
this.Close();
}
private void showCardButton_Click(object sender, EventArgs e)
{
// If a card is selected in the List Box, display it.
if (cardListBox.SelectedIndex != -1)
{
showCard(cardListBox.SelectedItem.ToString());
}
}
private void showCard (string card)
{
switch (card)
{
case "Ace of Spades":
playingCardPictureBox.Image = Properties.Resources.Ace_Spades;
break;
case "10 of Hearts":
playingCardPictureBox.Image = Properties.Resources._10_Hearts;
break;
case "King of Clubs":
playingCardPictureBox.Image = Properties.Resources.King_Clubs;
break;
}
}
}
}