|
-
Nov 30th, 2006, 03:15 AM
#1
Thread Starter
Fanatic Member
VB2005 The right event
Hello,
I Have a form. (frmForm1)
On that form is a link to another (frmForm2) form that opens as a dialog.
When form2 closes I want to perfom an action on form1.
I tried the Activated event but that is called more often then when I close frmform2.
The action is only to be performed when form2 closes.
Does anybody have a suggestion to wich event to use???
-
Nov 30th, 2006, 03:23 AM
#2
Re: VB2005 The right event
You don't need an event. You display the dialogue by calling ShowDialog and it doesn't return until the form is closed. That means you just perform your action immediately after ShowDialog.
That's assuming that you want a modal dialogue. If not then you would handle the Closed event of the second form, not an event of the first.
-
Nov 30th, 2006, 03:29 AM
#3
Hyperactive Member
Re: VB2005 The right event
VisibleChanged should work, else you could include the things you want to do following the code that hides your form.
Hope that helps.
-
Nov 30th, 2006, 03:29 AM
#4
Thread Starter
Fanatic Member
Re: VB2005 The right event
Thank you.
Once again you guys helped me very very much.
I did the following:
VB Code:
Private Sub lblLand_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lblLand.LinkClicked
frmLanden.ShowDialog()
Call FillDataset()
End Sub
And it works perfectly
-
Nov 30th, 2006, 03:33 AM
#5
Re: VB2005 The right event
Not that it will do any harm but note that the 'Call' keyword doesn't really serve a purpose in VB.NET. I have heard it said that it improves the readability of code but I can't say that I see that myself.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|