Esempio n. 1
0
        public MainWindow()
        {
            this.Size = new System.Drawing.Size(500, 380);
            this.Text = "Untitled Application";
            Application.EnableVisualStyles();

            selectFolderBtn = new Button();
            selectFolderBtn.Text = "Add folder with images...";
            selectFolderBtn.Click += HandleSelectFolderBtnClick;
            selectFolderBtn.Location = new System.Drawing.Point(5, 210);
            selectFolderBtn.Size = new System.Drawing.Size(200, 30);
            selectFolderBtn.Show();
            this.Controls.Add(selectFolderBtn);

            selectImageBtn = new Button();
            selectImageBtn.Text = "Add single images...";
            selectImageBtn.Click += HandleSelectImageBtnClick;
            selectImageBtn.Location = new System.Drawing.Point(5, 245);
            selectImageBtn.Size = new System.Drawing.Size(200, 30);
            selectImageBtn.Show();
            this.Controls.Add(selectImageBtn);

            deleteSelectedBtn = new Button();
            deleteSelectedBtn.Text = "Remove selected image from list";
            deleteSelectedBtn.Click += HandleDeleteSelectedBtnClick;
            deleteSelectedBtn.Location = new System.Drawing.Point(5, 280);
            deleteSelectedBtn.Size = new System.Drawing.Size(200, 30);
            deleteSelectedBtn.Show();
            this.Controls.Add(deleteSelectedBtn);

            clearListBtn = new Button();
            clearListBtn.Text = "Clear list";
            clearListBtn.Click += HandleClearListBtnClick;
            clearListBtn.Location = new System.Drawing.Point(5, 315);
            clearListBtn.Size = new System.Drawing.Size(200, 30);
            clearListBtn.Show();
            this.Controls.Add(clearListBtn);

            fileSelectList = new CheckedListBox();
            fileSelectList.Location = new System.Drawing.Point(5, 5);
            fileSelectList.Size = new System.Drawing.Size(200, 200);
            fileSelectList.Show();
            this.Controls.Add(fileSelectList);

            startPresentationBtn = new Button();
            startPresentationBtn.Text = "Start Presentation";
            startPresentationBtn.Location = new System.Drawing.Point(250, 210);
            startPresentationBtn.Size = new System.Drawing.Size(200, 30);
            startPresentationBtn.Click += HandleStartPresentationBtnClick;
            startPresentationBtn.Show();
            this.Controls.Add(startPresentationBtn);

            Label numOfSecondsLbl = new Label();
            numOfSecondsLbl.Text = "Delay in seconds:";
            numOfSecondsLbl.Location = new System.Drawing.Point(250, 45);
            numOfSecondsLbl.Size = new System.Drawing.Size(100, 30);
            numOfSecondsLbl.Show();
            this.Controls.Add(numOfSecondsLbl);

            Label numOfTilesLbl = new Label();
            numOfTilesLbl.Text = "Number of tiles:";
            numOfTilesLbl.Location = new System.Drawing.Point(250, 85);
            numOfTilesLbl.Size = new System.Drawing.Size(100, 30);
            numOfTilesLbl.Show();
            this.Controls.Add(numOfTilesLbl);

            numOfTilesBox = new ComboBox();
            numOfTilesBox.DropDownStyle = ComboBoxStyle.DropDownList;
            for (int i = 1; i < 21; i++)
            {
                numOfTilesBox.Items.Add(i*i);
            }
            numOfTilesBox.SelectedItem = 16;
            numOfTilesBox.Location = new System.Drawing.Point(380, 85);
            numOfTilesBox.Size = new System.Drawing.Size(100, 30);
            numOfTilesBox.Show();
            this.Controls.Add(numOfTilesBox);

            secondsBox = new NumericUpDown();
            secondsBox.Maximum = 60;
            secondsBox.Minimum = 1;
            secondsBox.Value = 5;
            secondsBox.Location = new System.Drawing.Point(380, 45);
            secondsBox.Size = new System.Drawing.Size(100, 30);
            secondsBox.Show();
            this.Controls.Add(secondsBox);
        }