|
-
May 19th, 2003, 04:27 PM
#1
Thread Starter
Addicted Member
Odd 2 form issue * Resolved *
Came across something today and I am not quite sure how to get around it or why it is happening. I dont have access to the code here so I will post it tomorrow if you need to see it but here is what's happening:
I have two forms. MainForm and LogForm. MainForm is the app itself and LogForm is nothing more than a form with a textbox (txtLog).
During the execution on MainForm data gets appended to the txtLog text box on LogForm (LogForm.txtLog.AppendText, etc....) This works great and if I open up the log the data is appended properly. However if I try to execute the command again once I view the log the code breaks and on the line where it writes to the txtLog file it comes back saying that it cannot access the textbox.
Now the odd thing is I can execute the command as many times as I want so long as I never call up that LogForm form. However the second I do if I try to run the command again that appends the text it dies.
Anyone have any thoughts on this. I am calling the form (LogForm) with a simple
Dim LogForm as New frmLog
frmLog.Show()
Which might even be the problem, I just dont know.
Oh yea and to close the LogForm it is just a cmd button of Me.Close.
Thanks in advance.
Jim
Last edited by jlegan; May 20th, 2003 at 03:56 PM.
-
May 19th, 2003, 05:12 PM
#2
Fanatic Member
How about the code behind what you're talking about.
-
May 19th, 2003, 05:18 PM
#3
Thread Starter
Addicted Member
hehe ok here is the code (syntax might be off a bit, doing it from memory)
Dim LogView as New frmLog
Whole bunch of For and If loops down here...
Within one of them there is the following:
VB Code:
LogView.txtLog.AppendText ("HI Everyone")
Now of course in the program Hi Everyone is not what is written but rather as part of the For loop it goes throug a certain variable is written. Now there is a menu item that does a simple.
When a click that menu item the frmLog loads and all of my appended code from my For loop is present. That form as a Me.Close button.
Once I close it if I run the command button again on the main form that enters that For Loop (and thus text gets appended to LogView.txtLog again) the code breaks and says that the text box (txtLog) is not accessible.
I think somehow it is either being locked and not released or somehow stuck in memory after I open the Log for the first time.
Let me know if you have any ideas.
Thanks,
Jim
-
May 19th, 2003, 07:41 PM
#4
yay gay
try .ShowDialog() instead
\m/  \m/
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
|