Click here to Skip to main content
15,887,434 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi, I'm making a program where I need a messagebox, later found out that this one, blocking me from clicking on the form that was called by (modal type). Now I like to make the form where msg appears an owner of it so the messagebox window can stay on idle, until I click yes or no, and do selection on the form and after confirm it trough that idle window. I am more on the way to choosing the owner, I tried to put the owner, but still block me from clicking on the form.

What I have tried:

MsgBox("it's ok with the choose?", MessageBoxButtons.YesNo, Owner)
           If MsgBoxResult.Yes Then
               tempArray(counter) = "[img" & "(" & ComboBox2.Text.ToString & ") ]" & vbCrLf & "[img" & "(" & tempArray(counter) & ") ]" & "(" & tempArray2(counter) & ")"
           Else
Posted
Updated 1-Jan-22 8:31am

1 solution

MessageBox is always application model: once you show it, it "takes control" and nothing more happens with the "parent form" until it is closed.

To change this behaviour, you need to create your own (Form based) message box, and use the Form.Show method to display it. If you make it Topmost, it will always "sit over" other forms in the application.
Show does not create a modal dialog, and will return immediately so other processing can happen in the "parent" form as required.
 
Share this answer
 
Comments
[no name] 1-Jan-22 14:36pm    
@OriginalGriff Thank you, it's also possible to make the yes no dialogue like in messagebox, and halt the code when this form shows up, and when pressed yes continue with the cicle for?
OriginalGriff 1-Jan-22 14:52pm    
Yes.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900