What I'm trying to accomplish:
On runtime, I want my program to scan a destination and if it finds a certain file, it creates a new object, (a picturebox) on a TabPage on a form.
Problem:
I don't get any errors, or anything but my picturebox doesn't seem to show up, and I don't have a clue why, I'm trying to add this control to a tabpage, so I figure some how, thats giving me the problem... Below is my code for adding a new game to the tabpage. I tried this in another program just in the same class as a form, and on a form and it works, but some reason the tabpage isn't quite working out for me.
LeagueMain main = new LeagueMain();
private PictureBox newGame;
public void AddNewGame(string GameName, string GamePicPath, string GameExePath)
{
newGame = new PictureBox();
newGame.SizeMode = PictureBoxSizeMode.AutoSize;
newGame.Location = new System.Drawing.Point(50, 40);
newGame.Image = System.Drawing.Image.FromFile(GamePicPath);
main.tabMyGames.Controls.Add(newGame);
}
Thanks for any help