コード例 #1
0
        private void ProductForm_Load(object sender, EventArgs e)
        {
            String productInformation = "";

            for (int counter = 0; counter < productList.Count; counter++)
            {
                Product product = productList[counter];
                productInformation += String.Format("{0,-13}       {1,13:C}             {2}", product.getName(),
                                                    product.getPrice(), product.getStock());

                productInformation += "\r\n";
            }
            ProductInformationTextBox.Text = productInformation;
        }
コード例 #2
0
        public ProductForm(List <Product> productList)
        {
            InitializeComponent();

            this.productList = productList;

            String productInformation = "";

            for (int counter = 0; counter < productList.Count; counter++)
            {
                Product product = productList[counter];
                productInformation += String.Format("{0,-13}       {1,13:C}             {2}", product.getName(),
                                                    product.getPrice(), product.getStock());

                productInformation += "\r\n";
            }
            ProductInformationTextBox.Text = productInformation;
        }