|
-
Jul 15th, 2006, 09:30 PM
#1
Thread Starter
Member
[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?
-
Jul 16th, 2006, 02:15 AM
#2
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
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jul 17th, 2006, 09:10 AM
#3
Thread Starter
Member
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.
-
Jul 17th, 2006, 09:49 AM
#4
Re: [2.0] Hide frmMain from frmEdit?
This means frmMain is a class name, you must use create an object to use it
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jul 17th, 2006, 05:16 PM
#5
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|