|
Article relates to
|
RadControls for WinForms, Q2 2008
|
|
Created by
|
Nikolay Diyanov, Telerik
|
|
Last modified
|
August 22, 2008
|
|
Last modified by
|
Nikolay Diyanov, Telerik
|
HOW-TO
At some stage of your project you may decide to swtich from RadForm to ShapedForm or vice versa. This article discusses the migration process in details.
SOLUTION
Migrate from RadForm to ShapedForm
As demonstrated in
this Knowledge Base article, you should inherit your
Form from
ShapedForm instead of
RadFrom. When switching from
RadForm to
ShapedForm you will have serialized code that is only for
RadForm.
For example,
BeginInit() and
EndInit() exist only for RadForm so you will have to remove them.
The serialized code is similar to the code below:
| ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); |
| ... |
| ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); |
ShapedForm does not have
RootElement property as well, so you will have to remove it from the serialized code.
Then, in order to apply shape to the shaped form use the
RoundRectShape method as mentioned in this
Knowledge Base article. Since
ShapedForm does not have a title bar, you should drag
RadTitleBar from the
Toolbox on the form. Then, do not Dock it Top, because this will make
RadTitleBar cover the form's borders. Instead, anchor it to top, left and right and keep space for the border.
Migrate from ShapedForm to RadForm
In order to migrate your form from ShapedForm to RadForm, you should inherit the form from RadForm instead of from ShapedForm. RadForm does not have
Shape,
BorderColor or
BorderWidth properties, so you should delete the code concerning them. For additional information about the further steps of using
RadFrom, please refer to the respective
Knowledge Base article.
Please
Sign In
to rate this article.