您的位置:首页 > 其它

WinForms Controls > Examples > How to: Add New XtraForm, RibbonForm and XtraUserControl to Your Proj

2013-08-13 23:01 585 查看
WinForms Controls >Common
Concepts >
Examples >
How to: Add New XtraForm, RibbonForm and XtraUserControl to Your Project
 

This topic shows how you can add a new
XtraForm,
RibbonForm or
XtraUserControl to your project.
如何添加XtraForm、RibbonForm或XtraUserControl到项目

To learn how to convert an existing Form/UserControl to the XtraForm/RibbonForm/XtraUserControl, see How to: Convert Form to XtraForm (RibbonForm), and UserControl to XtraUserControl.

学习如何将已经存在的Form/UserControl 转换为XtraForm/RibbonForm/XtraUserControl,看:

 

Add New XtraForm, RibbonForm, XtraUserControl 添加新XtraForm, RibbonForm, XtraUserControl

Switch to the Solution Explorer and right-click your project name. Select the Add->New Item... menu option.切换到解决方案浏览器,右击项目名称,选择添加→新建项。。。菜单项



A dialog will open that lists available templates for creating new items.打开的对话框列出了创建新项可用的模板。



Select the required item to create a new DevExpress Form or UserControl.选择创建DevExpress Form或UserControl需要的项。
- DevExpress Form - creates a new
XtraForm. DevExpress Form-创建一个新的XtraForm

- DevExpress User Control - creates a new
XtraUserControl. DevExpress User Control 创建一个新的XtraUserControl.

- DevExpress RibbonForm - creates a new
RibbonForm. DevExpress RibbonForm -创建新的RibbonForm

How to: Convert Form to XtraForm (RibbonForm), and UserControl to XtraUserControl
如何:转换Form为XtraForm(RibbonForm)和UserControl到XtraUserControl

WinForms Controls >Common
Concepts >
Examples >
How to: Convert Form to XtraForm (RibbonForm), and UserControl to XtraUserControl

If you need to transform an existing Form or UserControl to a DevExpress

XtraForm,
RibbonForm or
XtraUserControl, simply modify the code that declares your Form/UserControl. Simply replace the Form's/UserControl's ancestor with the corresponding DevExpress class.
如果需要转换已经存在的Form或UserControl为DevExpressXtraForm,RibbonForm
or
XtraUserControl,简单的修改声明你窗体/用户控件UserControl的代码即可。简单的用相对于的DevExpress类替换Form或UserControl基类。
Before proceeding, ensure that
DevExpress.Data, DevExpress.Utils andDevExpress.XtraEditors libraries are added to the References section of your project. To use a RibbonForm, add theDevExpress.XtraBars library as well.

处理之前,保证DevExpress.Data,
DevExpress.Utils andDevExpress.XtraEditors库添加到了项目的引用部分。为使用RibbonForm,添加DevExpress.XtraBars库引用。
This example shows how to convert a standard form to XtraForm. Conversion to RibbonForm and XtraUserControl is performed in the same manner. 本例演示如何转换标准窗体到XtraForm。到RibbonForm和XtraUserControl实现操作与此一样。
1、译者住:首先需要添加对Xtra控件的引用,如下,项目的引用上右击,添加引用,选择.NET页,找到DevExpress.Data,
DevExpress.Utils andDevExpress.XtraEditors,用Ctrl+鼠标多选要添加的引用,然后点击确定,



 



 
2、Open a file that contains a form's declaration: in C# - a form's declaration can be found in the Form1.cs file, while in Visual Basic - the form is in the Form1.Designer.vb file). The form is
declared as follows.打开包含窗体声明的文件:C#- 窗体声明在文件Form1.cs,


C#
VB

public partial class Form1 : Form {
//... 
}


 


 
3、Rewrite this declaration as follows.按如下重写代码


C#
VB

public partial class Form1 : DevExpress.XtraEditors.XtraForm {
//... 
}


 


4、Then rebuild the project. 重新生成项目。
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: