예제 #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // 開啟檔案
            string[] lines = System.IO.File.ReadAllLines(@"D:\data.txt");

            // 分析
            foreach (string line in lines)
            {
                // 隔開
                string[] parts = line.Split('|');

                //建立元件
                addprice item = new addprice();

                //讀取
                item.Daytimes  = parts[0];
                item.ItemName  = parts[1];
                item.ItemPrice = parts[2];

                //增加項目
                TaskList.Children.Add(item);
            }
        }
예제 #2
0
        private void AddBtn_Click(object sender, RoutedEventArgs e)
        {
            addprice item = new addprice();

            TaskList.Children.Add(item);
        }