Re: bringing message box to front.



You would have to bring the Form app to the front prior to popping up the
MessageBox, as the MessageBox is shown as a modal dialog.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"mike" <mike@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DB1A5C38-B3C6-4A7A-9B40-2F39B74F53DE@xxxxxxxxxxxxxxxx
> Kevin,
> when I have just "me" the box only comes to the front of my vs app. I
> tried adding "Me.BringToFront", but that gives the overload error. Is
> there
> a way to bring this message box to the front of all apps? I am using .Net
> 1.1
>
> thanks
> Mike
>
> "Kevin Spencer" wrote:
>
>> Yes, sorry. I should have said "Me" instead of "Me.Handle".
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> Neither a follower nor a lender be.
>>
>> "mike" <mike@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:360872BE-2EDE-4ABF-8859-EAF176C38B43@xxxxxxxxxxxxxxxx
>> > Kevin,
>> > Since I am new to vb and vb.net I tried your suggestion. However,
>> > I
>> > now get the following error when I add the me.handle in the
>> > message.show
>> > as info I have imported system.intptr and system.io for this module.
>> >
>> > What else am I missing.
>> >
>> > G:\SERVCENT\VBcode_lib\CeTanks\VBNET\CETanks\FrmMainMenu.vb(210):
>> > Overload
>> > resolution failed because no accessible 'Show' can be called with these
>> > arguments:
>> > 'Public Shared Function Show(owner As
>> > System.Windows.Forms.IWin32Window,
>> > text As String) As System.Windows.Forms.DialogResult': Value of type
>> > 'System.IntPtr' cannot be converted to
>> > 'System.Windows.Forms.IWin32Window'.
>> > 'Public Shared Function Show(text As String, caption As String) As
>> > System.Windows.Forms.DialogResult': Value of type 'System.IntPtr'
>> > cannot
>> > be
>> > converted to 'String'.
>> >
>> >
>> >
>> > "Kevin Spencer" wrote:
>> >
>> >> Assuming your using .Net Framework 1.1, there are overloads to the
>> >> MessageBox.Show() method that take an IWin32Window parameter, which is
>> >> the
>> >> handle to the owner window. Example:
>> >>
>> >> MessageBox.Show(Me.Handle, "Finished Circ " & CIRC7 & " with " &
>> >> Gcount &
>> >> "
>> >> cleared and
>> >> " & ECOUNT & " failed.")
>> >>
>> >> --
>> >> HTH,
>> >>
>> >> Kevin Spencer
>> >> Microsoft MVP
>> >> ..Net Developer
>> >> Neither a follower nor a lender be.
>> >>
>> >> "mike" <mike@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> >> news:BCFAB71D-D2FA-434D-A2BE-BA5EF6567A00@xxxxxxxxxxxxxxxx
>> >> >I have several apps that display information to the user when
>> >> >completed.
>> >> >The
>> >> > problem is that when the app finishes it pops the messagebox but
>> >> > does
>> >> > not
>> >> > bring it to the front. How do I do that??
>> >> >
>> >> > Here is the code I am using
>> >> >
>> >> > MessageBox.Show("Finished Circ " & CIRC7 & " with " & Gcount & "
>> >> > cleared
>> >> > and
>> >> > " & ECOUNT & " failed.")
>> >> >
>> >> > thanks in advance
>> >>
>> >>
>> >>
>>
>>
>>


.



Relevant Pages

  • Re: Exception when use MessageBox.Show in prog with long path
    ... We too are seeing similar errors over here with a 1.1 app. ... String text, String caption, MessageBoxButtons buttons, MessageBoxIcon ... Sometimes the MessageBox would successfully pop up, ... but rather to the directory where the EXE is. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: MessageBox hangs app. AfxMessageBox
    ... When I try to put up an AfxMessageBox or MessageBox, the app. ... Right click on the control and do "Add Variable" to get a control ...
    (microsoft.public.vc.mfc)
  • Re: Message Detached With Timeout
    ... Just use an HTA. ... You can store the HTA description in your app and launch ... When my app is unloading this "messagebox" is launched. ...
    (microsoft.public.vb.general.discussion)
  • RE: Bug in Norton FireWall 2003
    ... depending on how the app works. ... the OK button of any messagebox. ... Just trying to force the prompt ... delivering to the intended recipient, be advised that you have received ...
    (Vuln-Dev)
  • Re: Exception when use MessageBox.Show in prog with long path
    ... We too are seeing similar errors over here with a 1.1 app. ... The other day one of our devs reported that the unit tests were failing ... Sometimes the MessageBox would successfully pop up, ... but rather to the directory where the EXE is. ...
    (microsoft.public.dotnet.framework.windowsforms)