Telerik

Log In

Overview and usage of RadForm

Article Info

Rating: 4

Article information

Article relates to

RadControls for Winforms, Q1 2008

Created by

Martin Vasilev

Last modified

April 18, 2008

Last modified by

Martin Vasilev



HOW-TO
Use RadForm control

DESCRIPTION
The purpose of this article is to familiarize you with the RadForm control and to demonstrate some of its features.

OVERVIEW
The RadForm control allows you to design and display a rounded Windows form that resembles the Office 2007 style. The control comes with an integrated TitleBar to easily add forms with a custom look and feel. The shape of RadForm is predefined, and unlike the ShapedForm it cannot be changed. The RadForm is NOT a descendant of ShapedForm.

It offers a new way of rapidly creating themed windows forms. The ShapedForm remains as a control that offers more flexibility when you need to make a custom and specifically shaped window.

USAGE
It is very easy to migrate from the standard .NET 2.0 Form to a RadForm. You only need to change the inheritance of your form from the standard Microsoft Form to RadForm, as shown below: 

 
[C#] Inheriting from RadForm: 
 
namespace RadFormDemo  
{  
   public partial class Form1 : Telerik.WinControls.RadForm  
   {  
       public Form1()  
       {  
           InitializeComponent();  
       }  
   }  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
[VB.NET] Inheriting from RadForm:
 

Class Form1  
    Inherits Telerik.WinControls.RadForm 

 
RadForm Elements

RadForm has its title bar and title bar buttons built-in. You can access the title bar and its buttons using the FormElement.TitleBar member. To customize the minimize, maximize and close buttons, use the RadTitleBar.TitleBarElement MinimizeButton, MaximizeButton and CloseButton members. Each button is a RadButtonElement type that includes properties to control text, image, and layout.

[C#] Accessing the title bar:
this.FormElement.TitleBar.Text = "Open File";  
this.FormElement.TitleBar.MaximizeButton.Enabled = false;  
this.FormElement.TitleBar.MinimizeButton.Enabled = false

[VB.NET] Accessing the title bar:
Me.FormElement.TitleBar.Text = "Open File" 
Me.FormElement.TitleBar.MaximizeButton.Enabled = False 
Me.FormElement.TitleBar.MinimizeButton.Enabled = False 

You can access the form border through FormElement.BorderPrimitive. Then you can customize the border to suit your needs:

[C#] Setting the border color to system default::
this.FormElement.BorderPrimitive.ForeColor = System.Drawing.Color.Green; 

[VB.NET] Setting the border color to system default:
Me.FormElement.BorderPrimitive.ForeColor = System.Drawing.Color.Green 

You can set the background color of the RadForm using the ClientFill property:

[C#] Setting the background color
this.FormElement.ClientFill.BackColor = System.Drawing.Color.Beige; 

[VB.NET] Setting the background color:
Me.FormElement.ClientFill.BackColor = System.Drawing.Color.Beige 

Comments

  • Rob Conley , Jul 11, 2008

    This would seem to only give some very basic options for the RadForm. I'm still looking for more detail. Also, 'ClientFill' appears to now be 'ClientFillPrimitive'?

  • Rik , Aug 4, 2008

    I installed the new version Q2 on VS2008 ( I never used telerik before) and the RadForm class not appear in the assembly

  • Telerik Admin , Aug 8, 2008

    Rik, thank you for your comment. We have started a new ticket on your behalf (Ticket ID 154924) to find out what the reason for not seeing the class is. You can locate the ticket in your Telerik account --> My Support Tickets.

  • Telerik Admin , Aug 26, 2008

    Rob, the docs have been improved to include more information on RadForm -- please, review them and share your feedback. As to 'ClientFill' you are right -- it is now 'ClientFillPrimitive'. The docs have been updated and the fix will appear in the next release. Thanks.

Please Sign In to rate this article.

Powered by Sitefinity ASP.NET CMS

Contact Us | Site Feedback | Terms of Use
Copyright © 2002-2008 Telerik. All rights reserved.