locked
Accessing imagelists (not a list containing images) from another class RRS feed

  • Spørgsmål

  • Hey guys,

    I needhelp with accessing imagelists from other classes; I'm making a card game so I need to be able to shift "cards" to other imagelists from different classes e.g. a click method.  How do I connect the classes? I have left some simplified code to help you out:

    public partial class frmMain : Form
        {
    //On the Load of the Form    
    public void Form1_Load(object sender, EventArgs e)
            {
                //Initialising Imagelists
                ImageList hand_P1 = new ImageList();
            
                ImageList tableCards = new ImageList();
            }
    //If a player wants to put down a card
    private void btnFold_P1_Click(object sender, EventArgs e)
            {
                 //Taking a card from player 1's hand to the table
              
                 hand_P1.RemoveAt(randomNumberHand1_P1);
            
                 tableCards.Add(randomNumberHand1_P1);
            }
        }
    • Flyttet af Cindy Meister MVP 25. september 2012 04:36 not vsto or Office related (From:Visual Studio Tools for Office)
    24. september 2012 09:56

Svar

Alle besvarelser