Click here to Skip to main content
16,013,581 members
Home / Discussions / C#
   

C#

 
General> C# question < Pin
Star Newb22-May-04 20:58
sussStar Newb22-May-04 20:58 
GeneralRe: > C# question < Pin
Colin Angus Mackay23-May-04 1:41
Colin Angus Mackay23-May-04 1:41 
GeneralRe: > C# question < Pin
Heath Stewart23-May-04 4:26
protectorHeath Stewart23-May-04 4:26 
GeneralNetwork Programming Pin
tsandl22-May-04 20:12
tsandl22-May-04 20:12 
GeneralRe: Network Programming Pin
Colin Angus Mackay23-May-04 1:48
Colin Angus Mackay23-May-04 1:48 
Generalredraw a form Pin
theDawckta22-May-04 16:22
theDawckta22-May-04 16:22 
GeneralRe: redraw a form Pin
Charlie Williams22-May-04 18:42
Charlie Williams22-May-04 18:42 
GeneralRe: redraw a form Pin
theDawckta22-May-04 19:11
theDawckta22-May-04 19:11 
Yeah your probably right. This time I'll give code. I'm just a beginner but I'm working on a poker game and have a picturBox on my table that displays the players cards face down. I want to redraw this picture to show one card then a card on top of that card like if a person was dealt one card then another. I've got the two bitmaps that I want to interchange but if I use showdialog I get a little flicker before the other bitmap comes up.I can't have the flicker cause it has to look like it just appeared onscreen and not redraw form1.

this is my player class and under that is my main method where I use AddCard
public class Player : Form1
{

PictureBox bust = new PictureBox();
PictureBox playerCard1 = new PictureBox();
PictureBox playerCard2 = new PictureBox();
PictureBox tableCards = new PictureBox();
PictureBox tableChip = new PictureBox();
TextBox playerMoney = new TextBox();
TextBox betAmount = new TextBox();
PictureBox button = new PictureBox();


public Player()
{

}

public Player(int cardLoc1, int cardLoc2, int cardSize1, int cardSize2, Form1 surface)
{
this.tableCards.Location = new System.Drawing.Point(cardLoc1, cardLoc2);
this.tableCards.Size = new System.Drawing.Size(cardSize1, cardSize2);
this.tableCards.BackColor = System.Drawing.Color.Black;
surface.Controls.Add(tableCards);


}

public void AddCard1(Form1 surface)
{

//surface.Controls.Add(tableCards);

this.tableCards.Image = Image.FromFile(System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyPictures)+ @"\1card.bmp");
surface.Controls.Add(this.tableCards);
}
}
}


[STAThread]
static void Main()
{
Form1 Game = new Form1();

Form2 Begin = new Form2();

Form1 Game = new Form1();

if(Begin.ShowDialog() != DialogResult.Abort)
{
Player seat1 = new Player(656, 272, 27, 44,
624, 280, 28, 22,
616, 152, 80, 32,
616, 184, 40, 56,
656, 184, 40, 56,
616, 240, 80, 13,
624, 304, 40, 13,
576, 120, 33, 33,
Game);


Game.ShowDialog();
seat1.AddCard1(Game);
Game.ShowDialog();

}

}

I hope this isn't confusing. If anyone can help I would greatly apprecciate it.
GeneralRe: redraw a form Pin
Charlie Williams22-May-04 19:22
Charlie Williams22-May-04 19:22 
GeneralRe: redraw a form Pin
theDawckta22-May-04 19:33
theDawckta22-May-04 19:33 
GeneralRe: redraw a form Pin
Heath Stewart23-May-04 4:18
protectorHeath Stewart23-May-04 4:18 
GeneralRe: redraw a form Pin
theDawckta23-May-04 8:21
theDawckta23-May-04 8:21 
GeneralRe: redraw a form Pin
Dave Kreskowiak23-May-04 16:25
mveDave Kreskowiak23-May-04 16:25 
GeneralRe: redraw a form Pin
theDawckta23-May-04 8:56
theDawckta23-May-04 8:56 
GeneralRe: redraw a form Pin
theDawckta22-May-04 19:34
theDawckta22-May-04 19:34 
GeneralRe: redraw a form Pin
Dave Kreskowiak23-May-04 4:23
mveDave Kreskowiak23-May-04 4:23 
General"On screen keyboard" user control Pin
Alan Zhao22-May-04 15:21
Alan Zhao22-May-04 15:21 
GeneralRe: "On screen keyboard" user control Pin
Marc Clifton23-May-04 3:07
mvaMarc Clifton23-May-04 3:07 
GeneralRe: "On screen keyboard" user control Pin
Alan Zhao23-May-04 3:53
Alan Zhao23-May-04 3:53 
GeneralRe: "On screen keyboard" user control Pin
Heath Stewart23-May-04 4:13
protectorHeath Stewart23-May-04 4:13 
GeneralRe: "On screen keyboard" user control Pin
Heath Stewart23-May-04 4:03
protectorHeath Stewart23-May-04 4:03 
GeneralRe: "On screen keyboard" user control Pin
Alan Zhao23-May-04 4:17
Alan Zhao23-May-04 4:17 
GeneralRe: "On screen keyboard" user control Pin
Heath Stewart23-May-04 4:20
protectorHeath Stewart23-May-04 4:20 
GeneralRe: "On screen keyboard" user control Pin
Marc Clifton23-May-04 4:25
mvaMarc Clifton23-May-04 4:25 
GeneralRe: "On screen keyboard" user control Pin
Alan Zhao23-May-04 5:59
Alan Zhao23-May-04 5:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.