1
Vote

ShowDialog()

description

ShowDialog() issue. the is is I created a panel and a button inside then when i click the button the form will appear but when i close the form, the form will show again. the form will reappear depend on how many times i click the ribbon button.
        private void ShowPanel() {
            // 
            // panel1
            // 
            this.panel1.BackColor = System.Drawing.SystemColors.Control;
            this.panel1.Controls.Add(this.button1);
            this.panel1.Location = new System.Drawing.Point(163, 177);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(200, 100);
            this.panel1.TabIndex = 1;
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(65, 41);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "button1";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);

            this.panel1.Controls.Add(button1);
            this.Controls.Add(this.panel1);
        }
        private void ribbonButton1_Click(object sender, EventArgs e)
        {
            this.ShowPanel();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Form2 repeatingform = new Form2();
            repeatingform.ShowDialog();

        }
P.S. I love office ribbon. i would like to contribute to fix this but I'm not that good at programming.

comments