It's kind of pathetic really. I have done so muchwith C# lately on this project, that this is the problem holding me back. For some reason I have no problem executing and dealing with Mysql statements, but I can't hide and show forms! before you think that this is easy, hear me out.
I have 2 forms. One is called frmMain, and the other is frmPassword. I'm basicly putting a simple password on this program. frmMain loads on execution. It checks a text file for a password. if a password exists, it then creates a new instance of frmPassword form, and displays it.
frmPassword frmPass = new frmPassword();
frmPass.Show();
All god so far. But now, I need to hide frmMain. Although frmMain is the one doing all the execution, it seems like all the people on google, and even the books im using, simply say to use this.Hide(); (or change the visible property) I'm not going to lie. That makes complete sense. Crazy part is, it doesn't work. Note that this is all in the frmMain_Load event. When I put a button on the form, and having the click event execute the hide method, the form hides itself, but that is no use to me. Next crazy part it: When I execute this code:
MessageBox.Show(sender.ToString());
under the load event, it returns the frmMain! It makes no sense. This is the problem I am having. Although solve one at a time, the next thing I need to do, is when the user puts in the password, I have to have it close frmPassword, and Show FrmMain.
I have researched this problem, and can't find any answers. I honestly can't figure it out. I didn't post much code as there isn't much to post. Between hide and show, the visible property, and creating the frmPassword, there is no code related. I'm going to head to bed now, and hope for some answers in the morning. Any help greatly appreciated. Thanks.
