Use modal form in a panel, or how to create a 'ShowDialog' like solution

R

Rene

Hi,

We are writing a touch screen application with two panels on the main (SDI)
form.

One panel is used for several forms, the other for selections. The
selections panel communicates with the forms panel.

In some cases we need to wait for a selection of the user. Displaying a new
modal form will move away from our main form and the selection panel is not
accessible.

We solved it for the time being with our own messageloop which is not
preffered. Another way could be with callback making the application much
complicated.

Is there an approach in C#/.NET how to solve this? Or are we stuck with our
own messageloop?

In pseudo code what we want:

// from anywhere in the application we will call:
Selection = AskSomeSelection("A", "B", "C", "D" );

if ( Selection == "A" ) DoSomethingA();


string AskSomeSelection()
{
// tell this form wants to be on the form panel
FormsPanel.Update (this);

// update selections panel
SelectionsPanel.Update (bla bla);

// wait till the user selected something
this.ShowDialog()

// return the selected option
returh this.Selected;

}


Rene
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top