Possible Duplicate:
How to know if a form is shown as dialog
I have a winform that may be opened as a dialogbox, or as a regular window.
When it is opened as a regular windows I want to hide the OK cancel buttons, is there any way of checking if a winform is opened as a dialogbox or not ?
You can use
Modalproperty:Source: http://msdn.microsoft.com/en-us/library/system.windows.forms.form.modal.aspx