Component One控件使用心得_onenote的使用心得
Component One控件使用心得由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“onenote的使用心得”。
Component One控件使用心得
Posted on 2007-09-11 12:50 石头 阅读(506)评论(1)编辑 收藏 引用 所属分类:.NET技术
Component One控件中的flexgrid控件,相信好多人都使用过吧,其功能不用多说了,主要是比.net中的datagrid控件使用起来方便,可以满足目前绝大数需要。比如遍历表格,高亮显示符合条件的单元格,行,列等
Dim cs As C1.Win.C1FlexGrid.CellStyle = flexGrid.Styles.Add(“Critical”)
cs.BackColor = Drawing.Color.Bisque
For col As Integer = flexGrid.Cols.Fixed To flexGrid.Cols.Count-1
If flexGrid.Cols(col).AllowEditing = False Then
flexGrid.Cols(col).Style = cs
End If
Next
2导出文件
可以很方便的导出到excel等
Dim File As New SaveFileDialog
Dim filename As String
File.Filter = “xls files(*.xls)|*.xls|All files(*.*)|*.*”
If File.ShowDialog = DialogResult.OK Then
If File.FileName.Trim().Length > 0 Then
filename = File.FileName.Trim()
File.OverwritePrompt = True
If _flex.Cols.Contains(“Check”)Then
_flex.Cols.Remove(“Check”)
End If
_flex.SaveGrid(filename,C1.Win.C1FlexGrid.FileFormatEnum.Excel,C1.Win.C1FlexGrid.FileFlags.IncludeFixedCells)
MeageBox.Show(“导出文件成功!”, “提示信息”, MeageBoxButtons.OK, MeageBoxIcon.Information)Else
MeageBox.Show(“请输入保存文件名称!”, “提示信息”, MeageBoxButtons.OK, MeageBoxIcon.Information)End If
还有好多常用功能,在这就不罗列了,有使用此控件的朋友,可以一起交流