[2.0] Hide frmMain from frmEdit?
I'm working on a program, and I'm completely done, except for one small problem. I need to hide frmMain if a function in frmEdit is successful.
Code:
try
{
FileStream fs = File.Open(Interaction.Command(), FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
BinaryReader br = new BinaryReader(fs);
BinaryWriter bw = new BinaryWriter(fs);
//Go to offset
br.BaseStream.Position = 444;
//Show string
strString = br.ReadString();
txtSString.Text = strString;
//Close br
br.Close();
frmMain.Hide();
}
However, it seems that frmMain.Hide(); doesnt work, is there a bit of code that could do this?
Re: [2.0] Hide frmMain from frmEdit?
Use a break point on the "frmMain.Hide();" line and see if nothing stops the code from being executed
Re: [2.0] Hide frmMain from frmEdit?
Tried that, it gives this error:
"An object reference is required for the nonstatic field, method, or property 'System.Windows.Forms.Control.Hide()"
Ugh, I've dug through tons of results on forums and google, nothing. How about a way to call a function in the code of frmMain, from frmEdit? I suppose that's not possible either, and it's just impossible to hide a form unless you do it on that form itself.
Re: [2.0] Hide frmMain from frmEdit?
This means frmMain is a class name, you must use create an object to use it
Re: [2.0] Hide frmMain from frmEdit?
You are obviously not fully familiar with the principles of OOP. I suggest that you read the "Forms in VB.NET" tutorial in my signature. The code examples are in VB but the principles are all exactly the same. You can use one of the links in my signature to convert the code examples if required.