I'm trying to make a very primitive guitar midi player with C#.
I'm in my beginning phase and having troubles with making my design.
The problem is that my array of buttons is displayed behind my picturebox.
I tried using putting my imagebox to the back:
this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(20, 100);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(624, 85);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
this.pictureBox1.SendToBack();
And tried to implement a bringtofront function:
public void maaktabs()
{
int x, y;
_tabs = new Button[6,13];
for (int i = 0; i < 6; i++)
{
for (int j = 0; j < 13; j++)
{
_tabs[i, j] = new Button();
_tabs[i, j].Location = new System.Drawing.Point(x, y);
_tabs[i, j].Size = new System.Drawing.Size(30, 30);
_tabs[i, j].Text = _tabsnaam[ i, j];
_tabs[i, j].BringToFront();
Controls.Add(_tabs[i, j]);
}
}
}
Without any succes, so my question is how can I make my buttons go in front of my image?
Am I using these functions wrongly?