lab6_2
This commit is contained in:
39
lab6_1/lab6_2_CalebFontenot/Form1.cs
Executable file
39
lab6_1/lab6_2_CalebFontenot/Form1.cs
Executable file
@@ -0,0 +1,39 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user