Note that there are some explanatory texts on larger screens.

plurals
  1. POC# Button Visibility Issue
    primarykey
    data
    text
    <p>I have programatically added several buttons to a C# Form, but only the ones I added via the Designer actually show up. The rest stay invisible even though. I am performing a lot of operations before this; could this perhaps be the cause?</p> <pre><code>public FormView { List&lt;Button&gt; listOfButtons = new List&lt;Button&gt;(); int frame = 0; for (int i = 0; i &lt; 36; i++) { listOfButtons.Add(new Button()); } listOfButtons[4 * frame].Width = 92; listOfButtons[4 * frame].Height = 92; listOfButtons[4 * frame].BackColor = Color.Red; listOfButtons[4 * frame].BackgroundImage = System.Drawing.Image.FromFile("image.png"); listOfButtons[4 * frame].BackgroundImageLayout = ImageLayout.Stretch; listOfButtons[4 * frame].ImageAlign = ContentAlignment.MiddleCenter; listOfButtons[4 * frame].TextAlign = ContentAlignment.TopCenter; listOfButtons[4 * frame].Location = new Point(1, 0); listOfButtons[4 * frame].Click += new EventHandler(this.button1_Click); listOfButtons[4 * frame + 1].Width = 92; listOfButtons[4 * frame + 1].Height = 92; listOfButtons[4 * frame + 1].BackColor = Color.Red; listOfButtons[4 * frame + 1].BackgroundImage = System.Drawing.Image.FromFile("image.png"); listOfButtons[4 * frame + 1].BackgroundImageLayout = ImageLayout.Stretch; listOfButtons[4 * frame + 1].ImageAlign = ContentAlignment.MiddleCenter; listOfButtons[4 * frame + 1].TextAlign = ContentAlignment.TopCenter; listOfButtons[4 * frame + 1].Location = new Point(1, 99); listOfButtons[4 * frame + 1].Click += new EventHandler(this.button2_Click); listOfButtons[4 * frame + 2].Width = 92; listOfButtons[4 * frame + 2].Height = 92; listOfButtons[4 * frame + 2].BackColor = Color.Red; listOfButtons[4 * frame + 2].BackgroundImage = System.Drawing.Image.FromFile("image.png"); listOfButtons[4 * frame + 2].BackgroundImageLayout = ImageLayout.Stretch; listOfButtons[4 * frame + 2].ImageAlign = ContentAlignment.MiddleCenter; listOfButtons[4 * frame + 2].TextAlign = ContentAlignment.TopCenter; listOfButtons[4 * frame + 2].Location = new Point(99, 0); listOfButtons[4 * frame + 2].Click += new EventHandler(this.button3_Click); listOfButtons[4 * frame + 3].Width = 92; listOfButtons[4 * frame + 3].Height = 92; listOfButtons[4 * frame + 3].BackColor = Color.Red; listOfButtons[4 * frame + 3].BackgroundImage = System.Drawing.Image.FromFile("image.png"); listOfButtons[4 * frame + 3].BackgroundImageLayout = ImageLayout.Stretch; listOfButtons[4 * frame + 3].ImageAlign = ContentAlignment.MiddleCenter; listOfButtons[4 * frame + 3].TextAlign = ContentAlignment.TopCenter; listOfButtons[4 * frame + 3].Location = new Point(99, 99); listOfButtons[4 * frame + 3].Click += new EventHandler(this.button4_Click); listOfButtons[4 * frame].Visible = true; listOfButtons[4 * frame + 1].Visible = true; listOfButtons[4 * frame + 2].Visible = true; listOfButtons[4 * frame + 3].Visible = true; InitializeComponent(); } </code></pre> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload