Msgbox problem

  • Thread starter Thread starter Sebastian Santacroce
  • Start date Start date
S

Sebastian Santacroce

Hello,
I'm trying get a message box to show useing messagebox.show
(...) and then checking what they chose. The only problem
is that when it pops up it is locking all other windows
until it the messagebox has been answered. I need it to
not look its parent form that is calling it. How can do
this?

Thanks

Sebastian
 
Sebastion,

if I understood you correctly, you want to display a dialog without locking
the windows underneath it. If you want to do that, you can't use MessageBox.
Instead, create a new dialog and display it with "show", not with
"showdialog" - that should work. Of course, in that case, you need a little
bit more effort to put the text into the form.

Klaus
 
Sebastian,
Unfortunately both MsgBox & MessgeBox are modal, as normally the info they
are presented needs to be taken care of.

If you need a modeless messagebox, I would suggest designing a new form that
is designed to be used Modeless (Show instead of ShowDialog) that looks &
feels like MessageBox. You can use the System.Drawing.SystemIcons class to
get the icons that the MessageBox class displays...

Hope this helps
Jay
 
Hi Sebastian,

A little addition to Klaus and Jay,

Throw an event when the checking is done and then put it somewhere in the
logic of your project.

And also put somewhere in your logic that the checking is done in time.

Those two things seems to me more a problem than show the form.

That is why dialogboxes and messagboxes are mostly waiting on an answer.

This is a kind of in my eyes difficult remote processing.

But just a thought maybe you have already the solution for that.

Cor
 
* "Sebastian Santacroce said:
I'm trying get a message box to show useing messagebox.show
(...) and then checking what they chose. The only problem
is that when it pops up it is locking all other windows
until it the messagebox has been answered. I need it to
not look its parent form that is calling it. How can do
this?

You will have to create your own messagebox. Some hints and tips on
doing that can be found here:

<http://groups.google.de/[email protected]>
 
Hi,
You can use a new thread.
Make a class
Public Class threaded
Public mstrQuestion As String
Public Sub New(ByVal strQuestion As String)
mstrQuestion = strQuestion
End Sub

Public Sub Doit()
if MsgBox(mstrQuestion, vbYesNo Or vbQuestion) = vbyes then
DoSomething
end if
End Sub
End Class

In the main form where you want the message box you need



Dim d As New threaded("My Question")
Dim ts As New ThreadStart(AddressOf d.Doit)
Dim t As New Thread(ts)
t.Start() '
'rest of main form code here




HTH
Bob
 
Back
Top