Click here to Skip to main content
16,016,391 members
Home / Discussions / C#
   

C#

 
AnswerRe: Send keystrokes Pin
GuyThiebaut27-May-08 21:14
professionalGuyThiebaut27-May-08 21:14 
GeneralRe: Send keystrokes Pin
xax28-May-08 2:00
xax28-May-08 2:00 
GeneralRe: Send keystrokes Pin
GuyThiebaut28-May-08 2:31
professionalGuyThiebaut28-May-08 2:31 
QuestionProblem in connection string Pin
Shuaib wasif khan27-May-08 8:59
Shuaib wasif khan27-May-08 8:59 
AnswerRe: Problem in connection string Pin
Wes Aday27-May-08 9:03
professionalWes Aday27-May-08 9:03 
AnswerRe: Problem in connection string Pin
Ennis Ray Lynch, Jr.27-May-08 9:09
Ennis Ray Lynch, Jr.27-May-08 9:09 
AnswerRe: Problem in connection string Pin
Shuaib wasif khan27-May-08 9:24
Shuaib wasif khan27-May-08 9:24 
QuestionPicturebox problem Pin
Joplinazz27-May-08 8:10
Joplinazz27-May-08 8:10 
Hi!

I've got two picture boxes on my form. The variables "firstDice" and "secondDice" are two randomly generated integer values.
I've also got a label under each picturebox that shows the generated value just to be able to see if the right
picture is shown in the picturebox, but that's not always the case..
I'm pretty sure I'm doing something wrong in the code when the picture box is told its "file location", but what?

Code:

switch (firstDice)
{
    case 1:
        label1.Text = "1";
        firstPictureLocation += "D:\\bilder\\1.gif";
        picBoxDice1.ImageLocation = firstPictureLocation;
        break;

    case 2:
        label1.Text = "2";
        firstPictureLocation += "D:\\bilder\\2.gif";
        picBoxDice1.ImageLocation = firstPictureLocation;
        break;

    case 3:
        label1.Text = "3";
        firstPictureLocation += "D:\\bilder\\3.gif";
        picBoxDice1.ImageLocation = firstPictureLocation;
        break;

    case 4:
        label1.Text = "4";
        firstPictureLocation += "D:\\bilder\\4.gif";
        picBoxDice1.ImageLocation = firstPictureLocation;
        break;

    case 5:
        label1.Text = "5";
        firstPictureLocation += "D:\\bilder\\5.gif";
        picBoxDice1.ImageLocation = firstPictureLocation;
        break;

    case 6:
        label1.Text = "6";
        firstPictureLocation += "D:\\bilder\\6.gif";
        picBoxDice1.ImageLocation = firstPictureLocation;
        break;
}

switch (secondDice)
{
    case 1:
        label4.Text = "1";
        secondPictureLocation += "D:\\bilder\\1.gif";
        picBoxDice2.ImageLocation = firstPictureLocation;
        break;

    case 2:
        label4.Text = "2";
        secondPictureLocation += "D:\\bilder\\2.gif";
        picBoxDice2.ImageLocation = firstPictureLocation;
        break;

    case 3:
        label4.Text = "3";
        secondPictureLocation += "D:\\bilder\\3.gif";
        picBoxDice2.ImageLocation = firstPictureLocation;
        break;

    case 4:
        label4.Text = "4";
        secondPictureLocation += "D:\\bilder\\4.gif";
        picBoxDice2.ImageLocation = firstPictureLocation;
        break;

    case 5:
        label4.Text = "5";
        secondPictureLocation += "D:\\bilder\\5.gif";
        picBoxDice2.ImageLocation = firstPictureLocation;
        break;

    case 6:
        label4.Text = "6";
        secondPictureLocation += "D:\\bilder\\6.gif";
        picBoxDice2.ImageLocation = firstPictureLocation;
        break;
}


/Joplinazz
AnswerRe: Picturebox problem Pin
led mike27-May-08 8:39
led mike27-May-08 8:39 
AnswerRe: Picturebox problem Pin
Anthony Mushrow27-May-08 8:41
professionalAnthony Mushrow27-May-08 8:41 
GeneralRe: Picturebox problem Pin
Joplinazz27-May-08 8:47
Joplinazz27-May-08 8:47 
AnswerRe: Picturebox problem Pin
MarkB77727-May-08 14:07
MarkB77727-May-08 14:07 
QuestionUsing static ADO methods in the Data Layer ADO class. Pin
Steve Holdorf27-May-08 6:01
Steve Holdorf27-May-08 6:01 
AnswerRe: Using static ADO methods in the Data Layer ADO class. Pin
N a v a n e e t h27-May-08 6:23
N a v a n e e t h27-May-08 6:23 
Generalecommerce -pay pal Pin
uniqueanurag27-May-08 4:44
uniqueanurag27-May-08 4:44 
GeneralRe: ecommerce -pay pal Pin
Judah Gabriel Himango27-May-08 6:37
sponsorJudah Gabriel Himango27-May-08 6:37 
GeneralRe: ecommerce -pay pal Pin
Krazy Programmer27-May-08 7:36
Krazy Programmer27-May-08 7:36 
GeneralRe: ecommerce -pay pal Pin
Ennis Ray Lynch, Jr.27-May-08 9:10
Ennis Ray Lynch, Jr.27-May-08 9:10 
QuestionDispose off Notify Icon in Console Application.. Pin
ptr2void27-May-08 4:07
ptr2void27-May-08 4:07 
AnswerRe: Dispose off Notify Icon in Console Application.. Pin
Anthony Mushrow27-May-08 4:32
professionalAnthony Mushrow27-May-08 4:32 
GeneralRe: Dispose off Notify Icon in Console Application.. Pin
leppie27-May-08 5:48
leppie27-May-08 5:48 
GeneralRe: Dispose off Notify Icon in Console Application.. Pin
Anthony Mushrow27-May-08 5:56
professionalAnthony Mushrow27-May-08 5:56 
AnswerRe: Dispose off Notify Icon in Console Application.. Pin
leppie27-May-08 5:46
leppie27-May-08 5:46 
JokeRe: Dispose off Notify Icon in Console Application.. Pin
Anthony Mushrow27-May-08 5:57
professionalAnthony Mushrow27-May-08 5:57 
GeneralRe: Dispose off Notify Icon in Console Application.. Pin
leppie27-May-08 6:26
leppie27-May-08 6:26 

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.