By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,534 Members | 865 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,534 IT Pros & Developers. It's quick & easy.

Recalculate form

P: n/a
Hello,

I am using this sub to show a form as a control (thanks George) on a main
form. From a treeview the user can select which form should be shown and
worked on.

Private Sub ShowSubForm(ByVal sTabKey As String)

Dim ctl As Control

For Each ctl In Me.Controls
If TypeOf ctl Is Form Then
If ctl.Tag.ToString = sTabKey.ToString Then
ctl.BringToFront()
ctl.Show()
End If
End If
Next
End Sub

If a user later decides he wants to change a value in the first form, the
rest of the following forms need to be recalculated. Right now, I have to
show the form and loose focus on one of the textboxes to do this. I'd like
to have it done as soon as the form is brought to front again. But I can't
find any event that would trigger this.

Can someone help?

Thanks,

Jerry
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
DWS
Jerry
I did something similar once. I made a public method called DWS on each
form that would refresh the form controls and then just called the dws
function in a loop from the main thread. Nothing tricky but it got the job
done.

dim x as form
For Each x In Me.Controls
try
x.DWS
catch
endtry
next

Good Luck
DWS
"Jerry" wrote:
Hello,

I am using this sub to show a form as a control (thanks George) on a main
form. From a treeview the user can select which form should be shown and
worked on.

Private Sub ShowSubForm(ByVal sTabKey As String)

Dim ctl As Control

For Each ctl In Me.Controls
If TypeOf ctl Is Form Then
If ctl.Tag.ToString = sTabKey.ToString Then
ctl.BringToFront()
ctl.Show()
End If
End If
Next
End Sub

If a user later decides he wants to change a value in the first form, the
rest of the following forms need to be recalculated. Right now, I have to
show the form and loose focus on one of the textboxes to do this. I'd like
to have it done as soon as the form is brought to front again. But I can't
find any event that would trigger this.

Can someone help?

Thanks,

Jerry

Nov 21 '05 #2

P: n/a
You might also be able to use the form event "VisibleChanged", which
fires when your form comes up again.

Shane

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.