页面树结构
转至元数据结尾
转至元数据起始

C1Input旨在让你很容易自定义它的外观。你有无限的可能性对每个C1input控件改变它的默认外观。C1input为输入框提供了大量的属性样式,以及内置的WindowsXP和Office2007的主题。视觉样式
自定义C1Input的外观>视觉样式
C1Input有七种内置的主题:System,Office2007Blue,Office2007Black,Office2007Silver,Office2010Blue,Office2010Black, 和Office2010Silver
设定C1InputVisualStyle属性会控制绘制下面这些控件时使用的梯度和边框,包括
C1TextBox,C1Label,C1DbNavigator,C1DropDownControl,C1DateEdit(包括下拉日历),C1NumericEdit(包括下拉计算器),C1SplitButton,C1ComboBox,和C1Button.
要使用视觉样式自定义一个C1input控件的外观,需要设定VisualStyle为
Custom,Office2007Black,Office2007Blue,Office2007Silver,System,Office2010Blue,Office2010Black,或者Office2010Silver. 这个属性既可以在设计器中设定也可以在代码中设定。下面的表描述了每一个视觉样式。

视觉样式

描述

Custom

没有视觉样式(像往常一样使用风格和外观属性)。

Office2007Black

样式符合Office2007黑色主题。

Office2007Blue

样式符合Office2007蓝色主题。

Office2007Silver

样式符合Office2007银色主题。

System

样式符合现在的系统设定。

Office2010Blue

样式符合Office2010蓝色主题。

Office2010Black

样式符合Office2010黑色主题。

Office2010Silver

样式符合Office2010银色主题。

使用设计器

在属性窗口中找到VisualStyle属性并将它设定为
Custom,Office2007Black,Office2007Blue,Office2007Silver,System,Office2010Blue,Office2010Black,或者 Office2010Silver。在下面的例子中,VisualStyle属性设定为了Office2007Blue。

使用代码编辑器

在Form_Load事件中添加代码将VisualStyle属性设置为Custom,Office2007Black,Office2007Blue,Office2007Silver,或者 System。下面的代码将一个C1TextBox控件的VisualStyle属性设定为Office2007Blue:
Visual Basic

Visual Basic

Me.C1TextBox1.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue

C#

C#

this.c1TextBox1.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;

自定义视觉样式

没有使用视觉样式。

C1TextBox

C1CheckBox

C1Label

C1DbNavigator

C1DropDownControl

C1DateEdit

C1NumericEdit

 

 

C1Button

C1ComboBox

系统的视觉样式现在系统的设定

C1TextBox

C1CheckBox

C1Label

C1DbNavigator

C1DropDownControl

C1DateEdit

 

 

C1NumericEdit

C1Button

C1ComboBox
注意:为了演示,显注意:为了演示,显示了两个示了两个combobox

Office2007Black视觉样式
Office2007黑色主题

C1TextBox

C1CheckBox

C1Label

C1DbNavigator

C1DropDownControl

 

 

C1DateEdit

C1NumericEdit

C1Button

C1ComboBox
Note: For illustration purposes two comboboxes are shown.

Office2007Blue 视觉样式
TOffice2007蓝色主题

C1TextBox

C1CheckBox

C1Label

C1DbNavigator

C1DropDownControl

 

 

C1DateEdit

C1NumericEdit

C1Button

C1ComboBox 注意:注意:为了演示,显示了两个combobox

Office2007Silver 视觉样式
Office2007银色主题

C1TextBox

C1CheckBox

C1Label

C1DbNavigator

C1DropDownControl

 

 

C1DateEdit

C1NumericEdit

C1Button

C1ComboBox 注意:注意:为了演示,显示了两个combobox

Office2010Blue 视觉样式
Office2010蓝色主题。

C1TextBox

C1CheckBox

C1Label

C1DbNavigator

C1DropDownControl

 

 

C1DateEdit

C1NumericEdit

C1Button

C1ComboBox
注意:为了演示,显
示了两个combobox

Office2010Black 视觉样式
Office2010蓝色主题。

C1TextBox

C1CheckBox

C1Label

C1DbNavigator

C1DropDownControl

 

 

C1DateEdit

C1NumericEdit

C1Button

C1ComboBox
注意:为了演示,显
示了两个combobox

Office2010Silver 视觉样式
Office2010银色主题。

C1TextBox

C1CheckBox

C1Label

C1DbNavigator

C1DropDownControl

 

 

C1DateEdit

C1NumericEdit

C1Button

C1ComboBox
注意:为了演示,显
示了两个combobox

主题

除了视觉样式,你还可以使用C1ThemeController给C1Input控件提供其他的主题。.你也可以用ThemeDesigner创建你自己的主题。
要使用主题自定义C1Input的外观,你需要将C1ThemeController添加到你的控件托盘并且将Themes属性设定为下表列出的预先定义好的样式之一。
主题名称图片Office2007Black

Office2007Blue

Office2007Silver

Office2010Black

Office2010Blue

Office2010Silver

Office2013DarkGray

Office2013LightGray

Office2013White

ExpressionDark

 

 


ExpressionLight

GreenHouse

RainerOrange

ShinyBlue

Violette

VisualStyleOffice2010Black

VisualStyleOffice2010Blue

VisualStyleOffice2010Silver

VS2013Blue

 

 

VS2013Dark

VS2013Light

VS2013DarkSolar

VS2013Green

VS2013Purple

VS2013Red

VS2013Tan


设计时如何将样式提供给设计时如何将样式提供给C1Input控件控件
要使用带有任何C1Input控件的C1ThemeController组件,要完成下面的步骤:

  1. 在设计时,在窗体上添加任何的C1Input控件,例如C1ComboBox。
  2. 将C1ThemeController组件添加到你的控件托盘。C1ThemeController对话框就会出现了。

    如果你使用C1ThemeController2.0组件,一个C1ThemeController对话框就会出现。C1ThemeController对话框用于给应用程序中所有可以设主题的控件快速地设定主题,或者窗体上所有可以设定主题的控件设定主题,或者给不同的控件设定不同的主题。


    C1ThemeController对话框列出出现在你窗体上的所有控件。在你添加C1ThemeController对话框之前如果你的窗体上有可以设定主题的控件,该控件就会出现在对话框中。每个控件/组件初始设定为none,这样这些控件的属性就不会设定到不希望的值上了。

  3. 3. 在C1ThemeController对话框中点击在Form1和c1ComboBox1旁边的Theme下拉菜单,并选择一个预定义的主题,例如,Violette。

  1. 点击OK来保存和关闭C1ThemeController对话框。
  2. 运行程序,你就会看到你的Form和C1Combobox按Violette主题显示。


如何用编程给如何用编程给C1Input控件设定主题控件设定主题
下面代码说明了如果编程时使用RegisterTheme和etTheme方法设定内置的主题:
Visual Basic

Visual Basic

'Register the theme file with the C1ThemeController
C1.Win.C1Themes.C1ThemeController.RegisterTheme("C:\Users\Documents\Visual Studio
2010\Projects\ThemesProject\ShinyBlue.c1theme")
'Apply it to a control, use the theme name, not the file name
Me.c1ThemeController1.SetTheme(c1ComboBox1, "ShinyBlue")

C#

C#

//Register the theme file with the C1ThemeController;
C1.Win.C1Themes.C1ThemeController.RegisterTheme(@"C:\Users\Documents\Visual Studio
2010\Projects\ThemesProject\ShinyBlue.c1theme");
//Apply it to a control and use the theme name this.c1ThemeController1.SetTheme(c1ComboBox1, "ShinyBlue")

除了预定义的主题,你还可以使用Themes设计器定制你的主题。更多信息参见Themes forWinForms文件。

  • 无标签