Almost Modal

C

carlmanaster

Hi,

I want almost modal behavior from a form; any suggestions on how to go
about this?

I'm writing something Excel-like: the main form has a grid; clicking a
cell usually selects the cell, but if there's a dialog up with a text
field that expects a cell value, it should instead enter the cell name
into the dialog's field. Of course, if it's a true modal dialog, the
click gets ignored. If the dialog is just a regular window, the click
brings the main form in front of it...

Any ideas? Thanks in advance.

Peace,
--Carl
 
C

carlmanaster

Set the "almost modal" form's Topmost property to True.

Thanks, Norman. I had already done that, but needed to call Show()
instead of ShowDialog(), which I solved by replacing the Ask() function
I had written, which showed the dialog and returned a result, with
callbacks to the parent form, called from the OK and Cancel buttons. I
created an interface, ICellRequestor, and made the calling form
implement it; it all works out fairly well, although I prefer the
simple MyDialog.Ask() kind of approach. I suppose I could still get
something like that by setting up threads and blocking until the dialog
is dismissed, but - good enough for now.

Thanks for the suggestion.

Peace,
--Carl
 

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