示例#1
0
        public MainForm()
        {
            xmldatabase = new Xml();
            Csvwriter   = new Csvwriter();
            save        = new ReadDb(Csvwriter);
            InitializeComponent();

            //comboboxitem
            comboBoxmonth.Items.Add("January");
            comboBoxmonth.Items.Add("February");
            comboBoxmonth.Items.Add("March");
            comboBoxmonth.Items.Add("April");
            comboBoxmonth.Items.Add("May");
            comboBoxmonth.Items.Add("June");
            comboBoxmonth.Items.Add("July");
            comboBoxmonth.Items.Add("August");
            comboBoxmonth.Items.Add("September");
            comboBoxmonth.Items.Add("October");
            comboBoxmonth.Items.Add("November");
            comboBoxmonth.Items.Add("December");

            comboBoxYear.Items.Add("2020");
            comboBoxYear.Items.Add("2021");

            //listview setting
            this.listViewresult.View = View.Details;
            listViewresult.Columns.Add("database", 200);
            //listViewresult.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.HeaderSize);
            listViewresult.Columns.Add("info", 200);
            // listViewresult.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.HeaderSize);
            imageList           = new ImageList();
            imageList.ImageSize = new Size(20, 20);
            //add 3 images result
            imageList.Images.Add(Properties.Resources.nook);
            imageList.Images.Add(Properties.Resources.ok);
            imageList.Images.Add(Properties.Resources.question);
            imageList.Images.Add(Properties.Resources.hourglass);


            // tell your ListView to use the new image list
            listViewresult.SmallImageList = imageList;

            textBoxdbpath.Text  = xmldatabase.dbpath;
            textBoxcsvpath.Text = xmldatabase.csvpath;

            //set db and csv path object
            save.dbpath       = xmldatabase.dbpath;
            Csvwriter.csvpath = xmldatabase.csvpath;

            //popolate list
            this.createlist();
        }
示例#2
0
 public ReadDb(Csvwriter csv)
 {
     Csvwriter = csv;
 }