Skip to main content

Is there a way to exit a form and continue with the program without closing the form? It seems that the only way to continue with my program is to close the form. My program calls the form as follows:

INVOKE TestForm::ShowDialog.

Continue Program

 

In my form, I have the following code in order to exit the form and continue with the program:

           if e::KeyCode = type Keys::End

              invoke self::Close

           end-if.

 

But I wish for the form to remain visible(not closed) and continue with my program. I tried :

           if e::KeyCode = type Keys::End

              invoke self::goback

           end-if.

 

But this command just goes back to the form and not the program.

Is there a way to exit a form and continue with the program without closing the form? It seems that the only way to continue with my program is to close the form. My program calls the form as follows:

INVOKE TestForm::ShowDialog.

Continue Program

 

In my form, I have the following code in order to exit the form and continue with the program:

           if e::KeyCode = type Keys::End

              invoke self::Close

           end-if.

 

But I wish for the form to remain visible(not closed) and continue with my program. I tried :

           if e::KeyCode = type Keys::End

              invoke self::goback

           end-if.

 

But this command just goes back to the form and not the program.

This is really more of a Microsoft .Net WinForms application design question than it is a COBOL question.

But, study this example to see if it will help you:

/cobol/visualcobol/w/wikiid-16/428/how-to-handle-multiple-forms-in-a-windows-forms-application

 


Is there a way to exit a form and continue with the program without closing the form? It seems that the only way to continue with my program is to close the form. My program calls the form as follows:

INVOKE TestForm::ShowDialog.

Continue Program

 

In my form, I have the following code in order to exit the form and continue with the program:

           if e::KeyCode = type Keys::End

              invoke self::Close

           end-if.

 

But I wish for the form to remain visible(not closed) and continue with my program. I tried :

           if e::KeyCode = type Keys::End

              invoke self::goback

           end-if.

 

But this command just goes back to the form and not the program.

Try using

INVOKE TestForm::Show()

Instead of ShowDialog(). ShowDialog will show the form as a modal dialog which is blocking. Show() will open a new window without blocking the caller.


Try using

INVOKE TestForm::Show()

Instead of ShowDialog(). ShowDialog will show the form as a modal dialog which is blocking. Show() will open a new window without blocking the caller.

The INVOKE TestForm() splashes the form and is not really what I want to do. The form must receive input from the user then return to the program and, ideally, without closing itself. I suppose I will use multiple forms (a form on top of another form)  in order to achieve what I want to do.