Which event fires on return from a Formxx.show()?

H

Hexman

I have a tiny application (and yes this is my first vb.net prog) that
has 4 forms. Form1 has info that I want to "refresh" within
listboxes, etc when control returns to Form1.

Form1 has this code.

Dim FormToShow As Form
FormToShow = New fPref
FormToShow.Show()

Form2 gets a file directory dialog, identifies options, etc.

When Form2 finishes processing with "Me.Hide" and returns to Form1, I
want to refresh some of the list boxes, etc.

Any HELP for a newbie???

Hexman

P.S. I've tried GotFocus, Paint, etc with undesired results.
 
C

Chris Dunaway

Probably the simplest way is to add public properties to Form2 and then
show it using ShowDialog. Then when it closes, you can access those
properties from Form1 and update its controls.

Dim FormToShow As New Form2
FormToShow.ShowDialog()

When FormToShow is closed then back in Form1, access its properties:

Form1.TextBox1.Text = FormToShow.SomeStringProperty
Form1.ComboBox1.SelectedItem = FormToShow.SomeIntegerProperty

etc.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top