Deyan

You can use the following approach to disable the Close button of a RadForm component:

public RadFormTestForm()

{

InitializeComponent();

this.FormElement.TitleBar.CloseButton.Enabled = false;

}

privateconstint CP_NOCLOSE_BUTTON = 0x200;

protectedoverride CreateParams CreateParams

{

get

{

CreateParams myCp = base.CreateParams;

myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON;

return myCp;

}

}

Basically, the CreateParams property removes the style that shows a close button in the system menu and in the title bar of a standard windows form. However, since RadForm customizes the standard non-client area of a Windows Form, you will have to additionally disable the Close button in our Title Bar and also apply the style that removes it from the system menu (so that the user will not be able to still close the form from the system menu) .

Ivan Petrov

There are several properties which control the visibility of the minimize, maximize and close buttons. You can use RadForm properties MinimizeBox, MaximizeBox and ControlBox. Or you can directly access the buttons elements:

this.FormElement.TitleBar.MinimizeButton

this.FormElement.TitleBar.MaximizeButton

this.FormElement.TitleBar.CloseButton

You can then use the Visibility property to show/hide these button elements.

I hope this will be useful. Should you have further questions, feel free to write back.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.