I am having issues on how to assign stock names and respective price on the board positions in a monopoly game in C#, SO far i have only few lines of codes, I need some assistance.

stockname.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsFormsApplication1
{
    class stock
    {

        public string stockname;
        public string stockprice;
        public string stockposition;



    }



}


for my windows form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {


            stock newstock = new stock();
            newstock.stockname = "ATT";
            newstock.stockprice = "20";
            newstock.stockposition= "1";

        }

        }
        }

Hi,

OK so you have a class set up for your stock and you are using it correctly, from the looks of what you have given. How will you show the user the board?

This article has been dead for over six months. Start a new discussion instead.