Vb.net – Visual Basic 2010 Clearing a Picture Box

vb.netvisual studio 2010

Im trying to build a simple poker game in visual basic studio 2010. When I click btnShuffle I assign the five image place holders the default backside of the card

btnShuffle_onClick......

    picFlop1.Image = My.Resources.BlankCard    //saved in my resources folder
    picFlop2.Image = My.Resources.BlankCard    //and so on and so on...

end sub

and then in my btnDeal cards I have tried every version of picFlop1.Dispose(), picFlop1.Image = Nothing… etc that I can find and nothing seems to erase the blank image.. I've tried skipping the clear step and just writing the actual face card overtop of the blank card, but it doesn't seem to show threw the initial blank card.. any help would be great..

btnDeal_onClick...

   //find first five cards on deck and assign them by overwrite/delete blank card

   picflop1.Image = My.Resource.SomeCard  //Does Not Work
   picFlop1.Image.Dispose()     //Does Not Work
   picFlop1.Image = Nothing     //Does Not Work

end sub

UPDATE

I am assigning these blank cards… not in the shuffle function but in the timer1 interval function.. could that have anything to do with it? The methods listed above work in a btnReset_onClick

_Matt

Best Answer

How about?

PictureBox1.Image = New Image
Related Topic