how do u make multiple instances of a message box?

Winston

Junior Contributor
Joined
Jan 25, 2003
Messages
266
Location
Sydney, Australia
Ok this may sound weird

ok well im making a task schedular application

and once type of task is

quick message


which i use a message box to show the message

it works fine

so this is the rought idea of the code


PHP:
case task_quickmsg
msgbox(task_message,msgboxstyle.information+msgboxstyle.okonly,task_messagetitle)


it works fine

but when i add like 5 quick messages to test if it will all run

only one of them run

what do i need to do to make it all run

and the only message box that runs is the last quick message task on the list


thanks guys for the help
 
from what i understand, Its seems like you need a loop to retest your select case as long as necessary.
If not, post more info on the logic ur trying to implement.
 
well u see
my app is a task schedular

and one type of task is Quick Message

users enter the message, a time, a date and a task name of the task


then once the current time matches the time selected by the user the task then checks what type of task it is, it then detects that its a Quick Message

so it will display a message box with the message


but the thing is i added 4 quick messages and scheduled it to execute all at the same time to see if it will work, but it didnt instead only one of it worked so i was wondering what i have to do to make it all work
 
From what I know MessageBOx is modal, meaning that nothing in that program will happen until that messagebox is taken care of.
 
I would implement this differently.
first what mutant said is right, and even if you could easilly implement an non modal emulation of the msgbox, this is not very elegant.

What you could do is have an object maintaining a list of the notifications. Alert the user on the first notification and place an icon in the systray to notify.
The icon would gives a non invasive access to the list of events you wish to notify your user with, and let him manage them at will. either keep or delete tasks...
for the first notification you could use a small form next to the icon like the msmesseger (appearing 5 seconds) with a link to the list manager...
i'm sure you get it...
 
I don't know much about threading, but I believe that in this case,
you could create a new thread for each MessageBox and they
would all show. In this example, both MessageBoxes show simultaneously:
Visual Basic:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim t As New Threading.Thread(AddressOf MyOtherThread)

    t.Start()
    MessageBox.Show("The first messagebox")
End Sub

Private Sub MyOtherThread()
    MessageBox.Show("The second messagebox")
End Sub
You can read about multi-threading in the MSDN.
 
in that spirit, without threading, make a form with a label and an Ok button, call it msgbox. and call the show method (not showdialog wich is modal) of as many instances of it as you want and cover the screen with them...;)
 
hmm not working

if i use .show i get an error

and if i make a new thread the second msgbox appears in the taskbar

any more ideas

i want many msgboxes to appear

becoz if i make like 6 quick messages and it launches at the same time i need them all to appear

anymore?
 
Back
Top