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
>> >>
>> >>
>> >>
>>
>>
>>


.