|
-
Dec 14th, 2004, 10:04 PM
#1
Thread Starter
Addicted Member
VB.NET:Simple Question on MessageBox.......[Resolved]
Say i have two forms, A and B....
when i click one button from form A....it will load form B..
now how to let the messagebox to display on form B after form B is load when i click on form A button...
instead of displaying the MessageBox first before form B is load when i click on form A button ...
Thanks
Last edited by toytoy; Dec 17th, 2004 at 09:38 PM.
-
Dec 14th, 2004, 10:23 PM
#2
Frenzied Member
Re: VB.NET:Simple Question on MessageBox
What if showing the messagebox in form B load event?
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Dec 15th, 2004, 02:42 AM
#3
Thread Starter
Addicted Member
Re: VB.NET:Simple Question on MessageBox
I have already tried...
but the messagebox will appear before form B is load...
-
Dec 15th, 2004, 02:50 AM
#4
PowerPoster
Re: VB.NET:Simple Question on MessageBox
How about a timer control to display the MessageBox?
BTW, why are you showing the MessageBox on the form loading part?
-
Dec 15th, 2004, 03:02 AM
#5
Thread Starter
Addicted Member
Re: VB.NET:Simple Question on MessageBox
the idea is something like pop up messageboxbox when you open a new form..
when the user click on form A button ....say the user enter some data in
form A then it will save these data and display it on form B messagebox to
tell the user these data is what you key in or other ...etc
the idea is something there...
-
Dec 15th, 2004, 07:01 AM
#6
Addicted Member
Re: VB.NET:Simple Question on MessageBox
You should use form B Activated event:
Code:
Private Sub formB_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
if isFirsTime then
' show messagebox
end if
End Sub
regard J
-
Dec 15th, 2004, 07:28 AM
#7
Fanatic Member
Re: VB.NET:Simple Question on MessageBox
Do you want to pass some value from the calling form to the called form or its simply trying to show a message box?
-
Dec 15th, 2004, 08:03 AM
#8
Thread Starter
Addicted Member
Re: VB.NET:Simple Question on MessageBox
Yes..some value is going to pass through..
-
Dec 15th, 2004, 08:33 AM
#9
Fanatic Member
Re: VB.NET:Simple Question on MessageBox
in that case you might need to use properties on the called form. something like:
Code:
dim _CallingForm as form1
Public Property CallingForm() as form1
Get
return _CallingForm
end get
Set (ByVal value as Form1)
_CallingForm = Value
end set
end property
Above code on the called form and on the calling form, something like
PHP Code:
Callingform.textbox.text = textbox1.text
-
Dec 17th, 2004, 09:37 PM
#10
Thread Starter
Addicted Member
Re: VB.NET:Simple Question on MessageBox
I do it in a odd way....
but still can works...
Hope have any better way than this....
Code:
'In Form 1'
Private Sub btnGoToForm2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesbtnGoToForm2.Click
Dim a As New Form2
a.Show()
MessageBox.Show("Open Form 2")
a.Activate() ' probably not really needed, depends on your layout
Me.Hide()
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' no MessageBox here
End Sub
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
|