B
Bob
I have a function - UserSaysSave() - that asks user if they want to
save using System.Windows.Forms.MessageBox and Returns the Result.
Function UserSaysSave() As Boolean
if MessageBox.Show(strText, strCaption, MessageBoxButtons.YesNo,
MessageBoxIcon.Question, DefaultBtn) = DialogResult.Yes) Then
boolOK = True
End If
Return boolOK
--
In a btn_Click event I call this function and if they say no it should
do nothing and return them to the window/form/screen they were using
before MessageBox.Show() was called.
Sub btn_Click()
If UserSaysSave() Then
' Save code
End If
''' active window here should be the one prior to UserSaysSave(), yes?
End Sub
But it does *not* return them to the correct window/form/screen! It
Activates a different window, that's also open, instead of the one
prior to MessageBox.
No matter what I try, Me.Activate, me.BringToFront. Me.Show, it still
Activates the wrong window/form/screen directly after MessageBox.
I must confess here that the window/form/screen I expect to return to
is a TabPage (of a TabControl).
Any suggestions would be greatly appreciated
Thanks,
Bob
save using System.Windows.Forms.MessageBox and Returns the Result.
Function UserSaysSave() As Boolean
if MessageBox.Show(strText, strCaption, MessageBoxButtons.YesNo,
MessageBoxIcon.Question, DefaultBtn) = DialogResult.Yes) Then
boolOK = True
End If
Return boolOK
--
In a btn_Click event I call this function and if they say no it should
do nothing and return them to the window/form/screen they were using
before MessageBox.Show() was called.
Sub btn_Click()
If UserSaysSave() Then
' Save code
End If
''' active window here should be the one prior to UserSaysSave(), yes?
End Sub
But it does *not* return them to the correct window/form/screen! It
Activates a different window, that's also open, instead of the one
prior to MessageBox.
No matter what I try, Me.Activate, me.BringToFront. Me.Show, it still
Activates the wrong window/form/screen directly after MessageBox.
I must confess here that the window/form/screen I expect to return to
is a TabPage (of a TabControl).
Any suggestions would be greatly appreciated
Thanks,
Bob