Skip to main content

Accessing Value property from Date and Time Picker in .Net

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

Has one form, wants to be able to click on a button and have a different form popup

Resolution:

1) Create a new Cobol, windows form, name the project FormPopup

2) Add another form to the project ( Right click on the project in solution explorer, select Add New Item, Select a Windows Form, name it Form2, click OK)

3) Add a button control to the first Form (Form1).

4) Double Click on the button to create the button click event handler

5) In the repository add this line of code:

Class form-form2 as "FormPopup.Form2"

6) Go back to the button click event handler that was created (method button1_Click)

7) Add a working storage section with the following code:

01 newForm object reference form-form2.

8) In the procedure division add the following code:

set newForm to form-form2::"New"()

invoke newForm::"Show"().

9) Build and Run

(Instead of using the form's Show method you could use the ShowDialog method, but then this form would have to be closed or hidden before you could continue working with the rest of the application)

Old KB# 5352

0 replies

Be the first to reply!