Creating Form without Application.Run

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to create form that simply hold textboxes that I log info to during the execution of a single-thread application. In Java, I found JFrame ideal for the task, but I can't recreate the same design with Forms. I can create the Form without Application.Run( ), but when debugging, I can't seem to see any text that gets AppendText'ed to the form. I've done some searching, but cannot find any samples or documentation that use Forms without passing control to the Form. Any help?
 
JavaConvert said:
I would like to create form that simply hold textboxes that I log info to during the execution of a single-thread application. In Java, I found JFrame ideal for the task, but I can't recreate the same design with Forms. I can create the Form without Application.Run( ), but when debugging, I can't seem to see any text that gets AppendText'ed to the form. I've done some searching, but cannot find any samples or documentation that use Forms without passing control to the Form. Any help?

When you change a interface object, typically it updates internal state and
then marks itself for repainting. Repainting then occurs whenever there is a
break in processing. If there is no break, then you won't see the UI update.

You can force UI controls to repaint now by calling Update(). Try this and see
if it fixes your problem.
 
Thanks for the help, but Update( ) had no effect

But I did discover a new clue. The textbox in the form IS getting updated with the AppendText, BUT it seems to clear itself when I click on the window during debug. By default, the form is getting created behind the VS.Net window during debugging. So when I reduced the size of the Visual Studio window so the form was visible at the time of creation - the text updates can be seen. But if I click on the form window - any text in the textbox disappears and any new text is not shown as I step through the code

So maybe it is a debugging option or window property that is to blame. Any help with that



----- Julie wrote: ----

JavaConvert wrote
When you change a interface object, typically it updates internal state an
then marks itself for repainting. Repainting then occurs whenever there is
break in processing. If there is no break, then you won't see the UI update

You can force UI controls to repaint now by calling Update(). Try this and se
if it fixes your problem
 
JavaConvert said:
Thanks for the help, but Update( ) had no effect.

But I did discover a new clue. The textbox in the form IS getting updated with the AppendText, BUT it seems to clear itself when I click on the window during debug. By default, the form is getting created behind the VS.Net window during debugging. So when I reduced the size of the Visual Studio window so the form was visible at the time of creation - the text updates can be seen. But if I click on the form window - any text in the textbox disappears and any new text is not shown as I step through the code.

So maybe it is a debugging option or window property that is to blame. Any help with that?

While you are stepping through code w/ the debugger, the UI will essentially be
disabled. This is because when in break mode, the application is completely
stopped, and therefore cannot repaint itself.

If you are looking for diagnostic output during debugging, look into Trace and
related -- this outputs text to your debugger output window.
 
Back
Top