Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 22nd, 2016, 01:04 AM
Authorized User
 
Join Date: Dec 2013
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default help with web form asp.net C#

Hello I am creating a poker style game on my website, and I need a little help with with the different poker hands that you can get. I am trying to get the computer to know when a certain poker hand has been reached without having to do a million if statements. For example if you receive a 3 of a kind I want the computer to perform a certain task when it is reached, and I am not quite show of an easy way to accomplish this, and for all the different possible hands in poker. Here is a copy of my C# code, and the markup code as well. Any help would be greatly appreciated.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Drawing.Drawing2D;
using System.Threading;
using System.Windows.Forms;
using System.IO;

public partial class VideoPoker : System.Web.UI.Page
{
Random rand = new Random();

string[] CardDisplay = new string[5];
string[] UsedCard = new string[5];

double cash;

string[] two = new string[4];
string[] three = new string[4];
string[] four = new string[4];
string[] five = new string[4];
string[] six = new string[4];
string[] seven = new string[4];
string[] eight = new string[4];
string[] nine = new string[4];
string[] ten = new string[4];
string[] jack = new string[4];
string[] queen = new string[4];
string[] king = new string[4];
string[] ace = new string[4];

protected void Page_Load(object sender, EventArgs e)
{

two[0] = "~/GameStyles/VideoPoker/Images/Poker/TwoSpades.png";
two[1] = "~/GameStyles/VideoPoker/Images/Poker/TwoHearts.png";
two[2] = "~/GameStyles/VideoPoker/Images/Poker/TwoDiamonds.png";
two[3] = "~/GameStyles/VideoPoker/Images/Poker/TwoClubs.png";

three[0] = "~/GameStyles/VideoPoker/Images/Poker/ThreeSpades.png";
three[1] = "~/GameStyles/VideoPoker/Images/Poker/ThreeHearts.png";
three[2] = "~/GameStyles/VideoPoker/Images/Poker/ThreeDiamonds.png";
three[3] = "~/GameStyles/VideoPoker/Images/Poker/ThreeClubs.png";

four[0] = "~/GameStyles/VideoPoker/Images/Poker/FourSpades.png";
four[1] = "~/GameStyles/VideoPoker/Images/Poker/FourHearts.png";
four[2] = "~/GameStyles/VideoPoker/Images/Poker/FourDiamonds.png";
four[3] = "~/GameStyles/VideoPoker/Images/Poker/FourClubs.png";

five[0] = "~/GameStyles/VideoPoker/Images/Poker/FiveSpades.png";
five[1] = "~/GameStyles/VideoPoker/Images/Poker/FiveHearts.png";
five[2] = "~/GameStyles/VideoPoker/Images/Poker/FiveDiamonds.png";
five[3] = "~/GameStyles/VideoPoker/Images/Poker/FiveClubs.png";

six[0] = "~/GameStyles/VideoPoker/Images/Poker/SixSpades.png";
six[1] = "~/GameStyles/VideoPoker/Images/Poker/SixHearts.png";
six[2] = "~/GameStyles/VideoPoker/Images/Poker/SixDiamonds.png";
six[3] = "~/GameStyles/VideoPoker/Images/Poker/SixClubs.png";

seven[0] = "~/GameStyles/VideoPoker/Images/Poker/SevenSpades.png";
seven[1] = "~/GameStyles/VideoPoker/Images/Poker/SevenHearts.png";
seven[2] = "~/GameStyles/VideoPoker/Images/Poker/SevenDiamonds.png";
seven[3] = "~/GameStyles/VideoPoker/Images/Poker/SevenClubs.png";

eight[0] = "~/GameStyles/VideoPoker/Images/Poker/EightSpades.png";
eight[1] = "~/GameStyles/VideoPoker/Images/Poker/EightHearts.png";
eight[2] = "~/GameStyles/VideoPoker/Images/Poker/EightDiamonds.png";
eight[3] = "~/GameStyles/VideoPoker/Images/Poker/EightClubs.png";

nine[0] = "~/GameStyles/VideoPoker/Images/Poker/NineSpades.png";
nine[1] = "~/GameStyles/VideoPoker/Images/Poker/NineHearts.png";
nine[2] = "~/GameStyles/VideoPoker/Images/Poker/NineDiamonds.png";
nine[3] = "~/GameStyles/VideoPoker/Images/Poker/NineClubs.png";

ten[0] = "~/GameStyles/VideoPoker/Images/Poker/TenSpades.png";
ten[1] = "~/GameStyles/VideoPoker/Images/Poker/TenHearts.png";
ten[2] = "~/GameStyles/VideoPoker/Images/Poker/TenDiamonds.png";
ten[3] = "~/GameStyles/VideoPoker/Images/Poker/TenClubs.png";

jack[0] = "~/GameStyles/VideoPoker/Images/Poker/JackSpades.png";
jack[1] = "~/GameStyles/VideoPoker/Images/Poker/JackHearts.png";
jack[2] = "~/GameStyles/VideoPoker/Images/Poker/JackDiamonds.png";
jack[3] = "~/GameStyles/VideoPoker/Images/Poker/JackClubs.png";

queen[0] = "~/GameStyles/VideoPoker/Images/Poker/QueenSpades.png";
queen[1] = "~/GameStyles/VideoPoker/Images/Poker/QueenHearts.png";
queen[2] = "~/GameStyles/VideoPoker/Images/Poker/QueenDiamonds.png";
queen[3] = "~/GameStyles/VideoPoker/Images/Poker/QueenClubs.png";

king[0] = "~/GameStyles/VideoPoker/Images/Poker/KingSpades.png";
king[1] = "~/GameStyles/VideoPoker/Images/Poker/KingHearts.png";
king[2] = "~/GameStyles/VideoPoker/Images/Poker/KingDiamonds.png";
king[3] = "~/GameStyles/VideoPoker/Images/Poker/KingClubs.png";

ace[0] = "~/GameStyles/VideoPoker/Images/Poker/AceSpades.png";
ace[1] = "~/GameStyles/VideoPoker/Images/Poker/AcetHearts.png";
ace[2] = "~/GameStyles/VideoPoker/Images/Poker/AceDiamonds.png";
ace[3] = "~/GameStyles/VideoPoker/Images/Poker/AceClubs.png";

Pair();
TwoPair();
ThreeOfaKind();
Straight();
flush();
FullHouse();
FourOfaKind();
StraightFlush();
RoyalFlush();

for (int i = 0; i < 5; i++)
{
CardDisplay[i] = getRandomImage();
}

if (!IsPostBack)
{
Discard.Enabled = false;

PokerCard1.Enabled = false;
PokerCard2.Enabled = false;
PokerCard3.Enabled = false;
PokerCard4.Enabled = false;
PokerCard5.Enabled = false;

Hold1.Visible = false;
Hold2.Visible = false;
Hold3.Visible = false;
Hold4.Visible = false;
Hold5.Visible = false;
ErrorMessage.Visible = false;


PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);

}
}

public void Pair()
{
for (int i = 0; i < 4; i++)
{
if (two[i] == two[i])
{
//MessageBox.Show("hello");
}
}
}
public void TwoPair()
{
}
public void ThreeOfaKind()
{
}
public void Straight()
{
}
public void flush()
{
}
public void FullHouse()
{
}
public void FourOfaKind()
{
}
public void StraightFlush()
{
}
public void RoyalFlush()
{
}
private List<int> elections = new List<int>();

public string getRandomImage()
{
string[] fileNames = Directory.GetFiles(MapPath("~/GameStyles/VideoPoker/Images/Poker/"));
int CurrentPick;
while (true)
{
CurrentPick = rand.Next(fileNames.Length);
if (!elections.Contains(CurrentPick))
{
elections.Add(CurrentPick);
break;
}
}
string CardToShow = fileNames[CurrentPick];
return Path.GetFileName(CardToShow);
}
protected void Deal_Click(object sender, EventArgs e)
{
cash = Convert.ToDouble(Cash.Text);
cash = cash - 10;
Cash.Text = Convert.ToString(cash);

PokerCard1.Enabled = true;
PokerCard2.Enabled = true;
PokerCard3.Enabled = true;
PokerCard4.Enabled = true;
PokerCard5.Enabled = true;

Discard.Enabled = true;
Deal.Enabled = false;

Hold1.Visible = false;
Hold2.Visible = false;
Hold3.Visible = false;
Hold4.Visible = false;
Hold5.Visible = false;
ErrorMessage.Visible = false;


PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}

protected void PokerCard1_Click(object sender, EventArgs e)
{
Hold1.Visible = true;
}
protected void PokerCard2_Click(object sender, EventArgs e)
{
Hold2.Visible = true;
}
protected void PokerCard3_Click(object sender, EventArgs e)
{
Hold3.Visible = true;
}
protected void PokerCard4_Click(object sender, EventArgs e)
{
Hold4.Visible = true;
}
protected void PokerCard5_Click(object sender, EventArgs e)
{
Hold5.Visible = true;
}
protected void Discard_Click(object sender, EventArgs e)
{
Discard.Enabled = false;
Deal.Enabled = true;

PokerCard1.Enabled = false;
PokerCard2.Enabled = false;
PokerCard3.Enabled = false;
PokerCard4.Enabled = false;
PokerCard5.Enabled = false;
ErrorMessage.Visible = false;

WinningHand();

if (Hold1.Visible == true && Hold2.Visible == false && Hold3.Visible == false && Hold4.Visible == false && Hold5.Visible == false)
{
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold2.Visible == true && Hold1.Visible == false && Hold3.Visible == false && Hold4.Visible == false && Hold5.Visible == false)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold3.Visible == true && Hold1.Visible == false && Hold2.Visible == false && Hold4.Visible == false && Hold5.Visible == false)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold4.Visible == true && Hold1.Visible == false && Hold2.Visible == false && Hold3.Visible == false && Hold5.Visible == false)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold4.Visible == false && Hold1.Visible == false && Hold2.Visible == false && Hold3.Visible == false && Hold5.Visible == true)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
}
if (Hold1.Visible == true && Hold2.Visible == true && Hold3.Visible == false && Hold4.Visible == false && Hold5.Visible == false)
{
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold1.Visible == true && Hold2.Visible == true && Hold3.Visible == true && Hold4.Visible == false && Hold5.Visible == false)
{
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold1.Visible == true && Hold2.Visible == true && Hold3.Visible == true && Hold4.Visible == true && Hold5.Visible == false)
{
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}

if (Hold1.Visible == false && Hold2.Visible == true && Hold3.Visible == true && Hold4.Visible == false && Hold5.Visible == false)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold1.Visible == true && Hold2.Visible == true && Hold3.Visible == true && Hold4.Visible == true && Hold5.Visible == false)
{
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold1.Visible == false && Hold2.Visible == true && Hold3.Visible == true && Hold4.Visible == true && Hold5.Visible == true)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
}
if (Hold1.Visible == false && Hold2.Visible == true && Hold3.Visible == false && Hold4.Visible == true && Hold5.Visible == true)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
}
if (Hold1.Visible == false && Hold2.Visible == true && Hold3.Visible == false && Hold4.Visible == false && Hold5.Visible == true)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
}
if (Hold1.Visible == false && Hold2.Visible == true && Hold3.Visible == true && Hold4.Visible == false && Hold5.Visible == true)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
}
if (Hold1.Visible == false && Hold2.Visible == true && Hold3.Visible == true && Hold4.Visible == true && Hold5.Visible == false)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold1.Visible == false && Hold2.Visible == false && Hold3.Visible == true && Hold4.Visible == true && Hold5.Visible == true)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
}
if (Hold1.Visible == false && Hold2.Visible == false && Hold3.Visible == true && Hold4.Visible == true && Hold5.Visible == false)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold1.Visible == false && Hold2.Visible == true && Hold3.Visible == false && Hold4.Visible == true && Hold5.Visible == false)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold1.Visible == true && Hold2.Visible == false && Hold3.Visible == true && Hold4.Visible == true && Hold5.Visible == false)
{
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold1.Visible == true && Hold2.Visible == true && Hold3.Visible == false && Hold4.Visible == true && Hold5.Visible == false)
{
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold1.Visible == true && Hold2.Visible == true && Hold3.Visible == false && Hold4.Visible == false && Hold5.Visible == true)
{
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
}
if (Hold1.Visible == true && Hold2.Visible == true && Hold3.Visible == true && Hold4.Visible == false && Hold5.Visible == true)
{
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
}
if (Hold1.Visible == true && Hold2.Visible == true && Hold3.Visible == false && Hold4.Visible == true && Hold5.Visible == true)
{
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
}
if (Hold1.Visible == true && Hold2.Visible == false && Hold3.Visible == true && Hold4.Visible == false && Hold5.Visible == false)
{
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold1.Visible == true && Hold2.Visible == false && Hold3.Visible == true && Hold4.Visible == false && Hold5.Visible == true)
{
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
}
if (Hold1.Visible == false && Hold2.Visible == false && Hold3.Visible == true && Hold4.Visible == false && Hold5.Visible == true)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
}
if (Hold1.Visible == true && Hold2.Visible == false && Hold3.Visible == true && Hold4.Visible == true && Hold5.Visible == true)
{
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
}
if (Hold1.Visible == true && Hold2.Visible == false && Hold3.Visible == false && Hold4.Visible == true && Hold5.Visible == false)
{
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard5.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[4]);
}
if (Hold1.Visible == true && Hold2.Visible == false && Hold3.Visible == false && Hold4.Visible == false && Hold5.Visible == true)
{
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
PokerCard4.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[3]);
}
if (Hold1.Visible == true && Hold2.Visible == false && Hold3.Visible == false && Hold4.Visible == true && Hold5.Visible == true)
{
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
}
if (Hold1.Visible == false && Hold2.Visible == false && Hold3.Visible == false && Hold4.Visible == true && Hold5.Visible == true)
{
PokerCard1.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[0]);
PokerCard2.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[1]);
PokerCard3.ImageUrl = Path.Combine("~/GameStyles/VideoPoker/Images/Poker/", CardDisplay[2]);
}
if (Hold1.Visible == false && Hold2.Visible == false && Hold3.Visible == false && Hold4.Visible == false && Hold5.Visible == false)
{
Discard.Enabled = true;
Deal.Enabled = false;
PokerCard1.Enabled = true;
PokerCard2.Enabled = true;
PokerCard3.Enabled = true;
PokerCard4.Enabled = true;
PokerCard5.Enabled = true;
ErrorMessage.Visible = true;

}
}


public void WinningHand()
{
}
}



<asp:Image ID="PokerTable" runat="server"
ImageUrl="~/GameStyles/VideoPoker/Images/PokerTable/PokerTable.png" BorderWidth="4px" />
<asp:ImageButton ID="PokerCard1" class="PokerCard" runat="server"
ImageUrl="~/GameStyles/VideoPoker/Images/Poker" BorderWidth="4px" onclick="PokerCard1_Click" />
<asp:ImageButton ID="PokerCard2" class="PokerCard" runat="server"
ImageUrl="~/GameStyles/VideoPoker/Images/Poker" BorderWidth="4px" onclick="PokerCard2_Click" />
<asp:ImageButton ID="PokerCard3" class="PokerCard" runat="server"
ImageUrl="~/GameStyles/VideoPoker/Images/Poker" BorderWidth="4px" onclick="PokerCard3_Click" />
<asp:ImageButton ID="PokerCard4" class="PokerCard" runat="server"
ImageUrl="~/GameStyles/VideoPoker/Images/Poker" BorderWidth="4px" onclick="PokerCard4_Click" />
<asp:ImageButton ID="PokerCard5" class="PokerCard" runat="server"
ImageUrl="~/GameStyles/VideoPoker/Images/Poker" BorderWidth="4px" onclick="PokerCard5_Click" />

<asp:Button ID="Deal" runat="server" Text="Deal" onclick="Deal_Click" />
<asp:Button ID="Discard" runat="server" Text="Discard" onclick="Discard_Click" />

<asp:Label ID="Hold1" runat="server" Text="Hold"></asp:Label>
<asp:Label ID="Hold2" runat="server" Text="Hold"></asp:Label>
<asp:Label ID="Hold3" runat="server" Text="Hold"></asp:Label>
<asp:Label ID="Hold4" runat="server" Text="Hold"></asp:Label>
<asp:Label ID="Hold5" runat="server" Text="Hold"></asp:Label>
<asp:Label ID="ErrorMessage" runat="server" Text="You must hold at least one card"></asp:Label>
<asp:Label ID="Price" runat="server" Text="$10"></asp:Label>
<asp:Label ID="CashText" runat="server" Text="Cash"></asp:Label>
<asp:Label ID="Cash" runat="server" Text="200"></asp:Label>
<asp:Label ID="Winnings" runat="server" Text="0"></asp:Label>
<asp:Label ID="WinningsText" runat="server" Text="Winnings"></asp:Label>

Thank you for any help

Last edited by crossfire19; May 22nd, 2016 at 01:26 AM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add Paging for ASP.net Web Form? Gayathri79 ASP.NET 3.5 Basics 0 April 20th, 2010 12:39 AM
url routing in asp.net 3.5 web form Anto ASP.NET 3.5 Basics 1 April 10th, 2010 02:06 PM
Store ? in Oracle9i using asp.net web form nandini_net_in ASP.NET 2.0 Professional 0 October 17th, 2006 12:42 AM
Problem with Posting an ASP .Net web form eliea ASP.NET 1.0 and 1.1 Basics 4 September 11th, 2006 02:59 AM
Detect Web Form Field Changes in ASP.NET. sand133 ASP.NET 2.0 Professional 1 August 22nd, 2006 10:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.