My windows Application has a menu which opens an OpenFileDialog. When the button OK is pressed, I want to place the main form background and show a new Form (with two radiobuttons, one button).

From the New Form I must take information (which radiobutton was checked) and pass this information to the main form.
Can anyone help me?

Recommended Answers

All 4 Replies

Declare public variable in a Module. Store the radiobutton value in the variable and then retrieve the value stored in the public variable in the main form.

You can create public properties in your dialog form that can be accessed and the values can be passed back to the main form.

And how can I say the sequence
in OpenFileDialog OK pressed --> open new form with the main in the background --> Button pressed --> close new form --> restore the main form?
I declare a new class which constructs my new Form?
I generally have a problem with the handling of two forms...

Attached is a small example that shows just one of many ways that can be used to pass values between forms. This particular method creates a public property on the child form that can be accessed from the calling form.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.