Click here to Skip to main content
15,888,330 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
Hi to all of you, this is my first post on Code Project and I need help and/or ideas on how to implement a user control that would have a modal behavior.

My only problem is that I CAN'T be using any kind of form.

I already try this approach and it is not doing what we need it to do.

Our problem is that the application we are developing with C# 3.0 is a full screen application with security to enforce the user to stay in the application.

We are not using other forms because it would force the taskbar to appear and disable the main security of the parent full screen form.

So everything in the main form is a user control.

If you happen to know that this is not possible, could you simply elaborate a little more to explain with this is not possible.

Thanks for you're help and you're answer, cheer.
Posted
Comments
[no name] 15-Sep-12 9:02am    
"I CAN'T be using any kind of form", so what kind of container capable of containing user controls are you using?
Philippe Mercure 15-Sep-12 9:20am    
No I am using a form for the main form, but I cannot put the user control that we want to be modal in a new form and then just show this form. It need to be a user control in the main form with a modal behavior, sorry for the misunderstood.
[no name] 15-Sep-12 9:24am    
Sorry that makes no sense to me. Trying to use a modal form without using a modal form sounds like a poor design to me. Maybe someone else has some other ideas. Good luck.
Philippe Mercure 15-Sep-12 9:29am    
Ok maybe try it another way around, you need to create a full screen application with security to disable the start menu Alt+Tab and stuff like this. We already create a bunch of user control, but all of them are being use at the same time, like a UserControlClock and a UserControlDate. With all those user control we now need to ask the user if he want to delete or not something, basically we need the user to answer a question, Yes No. How would you do if you were not able to create a new form. Their must be a way with event, delegation, timer or a mix of them, to assure you that the user select Yes or No, before the main form can continue it execution.
[no name] 15-Sep-12 9:31am    
That exact thing that you are describing is called a MessageBox

1 solution

I found the solution to my problem, to have a UserControl have the behavior of a modal form.

It was pretty easy.

Just by using event handlers, I was able to hook up to the UserControl Yes and No button, then by displaying this UserControl full screen on the main form, would act like a modal form.

Thanks all for you're help, :).
 
Share this answer
 

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