Thanks to Robert and Christian for the help on this. I learned a lot in looking up event subscription, etc. Also, Robert's solution is what I was thinking of, but I couldn't quite see how to implement it. After seeing his solution, it is very clear. I am trying to find a way to check for an existing instance. For example, before declaring Dim F1 as New Form1 I'd like to know if I already have an instance named F1 running. I can't seem to find much to indicate how to do this. Maybe I just don't know how to search the help files that well yet. Is there a managed way to do this? Hal in AZ
halhamilton
Posts
-
Reading Existing Instances - Help? -
Reading Existing Instances - Help?Thanks Christian. I'll give that a shot! Hal in AZ
-
Reading Existing Instances - Help?Still doesn't address the problem. Let's say that in F1, TextBox1 and TextBox2 are private. Now, I write methods doText1 and doText2 with both Get and Set capability. Now we've taken care of the private part. BUT...it still doesn't do what I want. Inside of instance F2 (of Form2), I want to refer to these methods inside of instance F1 (of Form1). When I try to do something like F1.doText1.Set("yadayadayada") I still get a syntax error saying I haven't declared F1 from inside F2. In other words, inside of F2 any reference to F1 does not point to an instance. On the other hand, if (inside of F2) I DO declare the instance F1, it creates a NEW F1 rather than referring to the one I already have opened. I'd like, from instance F2 (of Form2), to be able to write something back to instance F1 (of Form1) without having the declaration construct a new instance named F1. Seems like this would be very easy, but I can't seem to get it to happen.:confused: Hal in AZ
-
Memory...Thanks Dave! That makes it less painful. Hal in AZ
-
Reading Existing Instances - Help?Sorry for not being clearer. The instance F1 is still visible, and its control TextBox1 contains data I want to use. I simply go to F2 to collect additional data, and want to put that data back into the same instance (F1) of Form1. Hal in AZ
-
Reading Existing Instances - Help?I'm fairly new to VB.NET, and am almost embarassed to ask this, but... If I already have a form instance open and want to refer back to it, how do I do that? Example --------- Public F1 as New Form1 '(say it has two textboxes 1 and 2) F1.show() 'Fill out TextBox1 Dim F2 as New Form2 F2.show() Now I'm in the F2 instance of Form2. I get some input that I now want to put back into F1. When I try the following in F2 F1.TextBox2.Text="yadayadayada" I get a syntax problem (squiggly underline) unless I re-instantiate F1 like so... Dim F1 as New Form1 This, of course, results in a new F1 instance, not the one I had before. Thanks for any help! If this is in any of my books, I can't seem to find it. Hal in AZ
-
Memory...Rage - do you happen to know if, in a System Tray application, the memory remains allocated? Looking at the Task Mgr, it seems that my fairly simple app is sucking 12MB while the icon just sits there. Thanks! Hal in AZ
-
Excel Interop with Existing File?Jim, Worked fine. Thanks very much! Funny that out of 3 different books no one mentioned this. Thanks again, Hal Hal in AZ
-
Excel Interop with Existing File?I've found numerous examples on doing interop by creating a NEW Excel file, but would like to open an existing Excel file from VB.NET and interop with that. I've tried "guessing" how to modify the examples, but with no luck. Can anyone point me to an example of how to open an existing Excel file in VB.NET so I can interop with it? Thanks for any help on this...:confused: Hal in AZ