Reputation: 1189
I am trying to develop Windows Form Application using Visual Studio 2010.
I drag the buttons from toolbox on Form 1
After running the Aplication i am getting this output.
I dont see any button on the screen.
I tried Bring to front property , I checked the code also button is add in the form.
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(316, 62);
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;
//
// button2
//
this.button2.Location = new System.Drawing.Point(184, 118);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 1;
this.button2.Text = "fdefdf";
this.button2.UseVisualStyleBackColor = true;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(439, 170);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
Upvotes: 0
Views: 11454
Reputation: 605
Have you tried to put this code in page_load?
button1.Visible = true;
button2.Visible = true;
Upvotes: 1
Reputation: 36
I believe the answer to this one might be simple in this particular case:
I'm only responding to this because I wasn't sure if it was related to my issue or not, but it appears not to be.
Upvotes: 0