T
Tony Johansson
Hello!
I have a user control that is put on the form when I click this event
handler.
private void BtnNewPlayer_Click(object sender, EventArgs e)
{
pg = new PlayerGUI();
int xPos = (guiCounter % 2) * pg.Width + 1;
int yPos = (guiCounter / 2) * pg.Height + 1;
pg.Location = new Point(xPos,yPos);
guiCounter++;
gameManager.PlayerGUIs.Add(pg);
pg.DrawHandle = false;
pg.StandHandle = false;
panel1.Controls.Add(pg);
dgvAllPlayers.DataSource = bindingSource;
}
This user control PlayerGUI contains several controls but one of these is a
TextBox called Name with a set and a get.
But what is the best solution to enter data into this created usercontrol
without creating a button to click on and then use
the instance of the user control to access the Name property. I hope it
exist some other way then to use a button that I mentioned in the previous
row.
I mean just to write somthing in the TextBox of the created user control
isn't of much use.
//Tony
Now to my problem I can't figure what the best solution is to enter data
into the created user control TextBox
I have a user control that is put on the form when I click this event
handler.
private void BtnNewPlayer_Click(object sender, EventArgs e)
{
pg = new PlayerGUI();
int xPos = (guiCounter % 2) * pg.Width + 1;
int yPos = (guiCounter / 2) * pg.Height + 1;
pg.Location = new Point(xPos,yPos);
guiCounter++;
gameManager.PlayerGUIs.Add(pg);
pg.DrawHandle = false;
pg.StandHandle = false;
panel1.Controls.Add(pg);
dgvAllPlayers.DataSource = bindingSource;
}
This user control PlayerGUI contains several controls but one of these is a
TextBox called Name with a set and a get.
But what is the best solution to enter data into this created usercontrol
without creating a button to click on and then use
the instance of the user control to access the Name property. I hope it
exist some other way then to use a button that I mentioned in the previous
row.
I mean just to write somthing in the TextBox of the created user control
isn't of much use.
//Tony
Now to my problem I can't figure what the best solution is to enter data
into the created user control TextBox