内容发布更新时间 : 2024/12/25 15:45:38星期一 下面是文章的全部内容请认真阅读。
NetAdvantage使用
1. 窗体导入命名空间:using Infragistics.Win;
using Infragistics.Win.UltraWinEditors;
2. 添加引用:Infragistics2.Shared.v10.3
Infragistics2.Shared.Win.Misc.v10.3
Infragistics2.Shared.Win.UltraWinDock.v10.3 Infragistics2.Shared.Win.UltraWinToolbars.v10.3 Infragistics2.Shared.Win.UltraWin控件名称.v10.3 Infragistics2.Shared.Win.v10.3
3.
ResourceManager rm = 项目名.Properties.Resources.ResourceManager;
4. 直接拖拽ultraToolbarsManager1到窗体上,窗体会直接变成Office2010样式;
在Form_Load里面写:(如图a,b,c)
this.ultraComboEditor1.DisplayStyle = EmbeddableElementDisplayStyle.Office2010;
this.ultraOptionSet1.GlyphInfo = Infragistics.Win.UIElementDrawParams.Office2010RadioButtonGlyphInfo; this.ultraCheckEditor2.GlyphInfo = Infragistics.Win.UIElementDrawParams.Office2010CheckBoxGlyphInfo;
a
b.
c.
//窗体加载时的事件
privatevoid Form1_Load(object sender, EventArgs e) {
this.cmbDisplayStyle.DataSource = Enum.GetValues(typeof(EmbeddableElementDisplayStyle)); this.cmbDisplayStyle.Value = EmbeddableElementDisplayStyle.Office2010;
this.chkApplyGlyph.Checked = true; //复选框是否选中 True }
//下拉窗选中时事件
privatevoid cmbDisplayStyle_SelectionChanged(object sender, EventArgs e) {
this.ultraDateTimeEditor1.DisplayStyle =(EmbeddableElementDisplayStyle)((UltraComboEditor)sender).Value; }
//复选框选中时事件
privatevoid chkApplyGlyph_CheckedChanged(object sender, EventArgs e) {
if (this.chkApplyGlyph.Checked){
this.ultraOptionSet1.GlyphInfo = Infragistics.Win.UIElementDrawParams.Office2010RadioButtonGlyphInfo; this.ultraCheckEditor2.GlyphInfo = Infragistics.Win.UIElementDrawParams.Office2010CheckBoxGlyphInfo; }else{
this.ultraOptionSet1.GlyphInfo = Infragistics.Win.UIElementDrawParams.StandardRadioButtonGlyphInfo; this.ultraCheckEditor2.GlyphInfo = Infragistics.Win.UIElementDrawParams.StandardCheckBoxGlyphInfo;
} }