tags:

views:

30

answers:

2

I have a model dialog consisting of a datagrid, and OK button, and a Cancel button. It probably should be resizable.

What settings for WindowStyle, etc., would you recommend?

A: 

This question is nearly impossible to answer with the details given (what does the dialog do? what is the design of your application?), so the only answer I feel can be given is: be consistent.

Make your dialog look as much like the rest of your application as possible, although depending on that design, you may want to draw attention to it a little bit more than your "regular" windows to make sure that it is acknowledged.

You probably want to set the owner of the dialog to the calling window, and you probably want to WindowStartupLocation to be CenterOwner.

Wonko the Sane
+2  A: 

If you are asking what technically is involved in displaying a modal window, then it just has to be shown with the ShowDialog() method call. The call will block until the user closes the window.

By default, a window will be shown with a WindowStyle of SingleBorderWindow and the user should be able to resize it.

You may also want to look at the property ShowInTaskbar if you don't want the dialog to appear in the taskbar.

Here's a link to the MSDN docs on the Window class for reference.

Eric
The tech is easy, I'm asking about style. Unfortuantely all the style guidelines I have are for WIndows 95.
Jonathan Allen
Eric