欢迎来到天天文库
浏览记录
ID:39549643
大小:57.50 KB
页数:6页
时间:2019-07-06
《Grid的使用-表格编辑器》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Drawing;usingSystem.Data;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Drawing.Text;usingSystem.Collections;usingFlexCell;namespaceDemo{publicpartialclassUserControl1:UserControl{//点击按钮之后改
2、变的背景色Colorc1=Color.FromArgb(194,224,255);publicUserControl1(){InitializeComponent();}privatevoidUserControl1_Load(objectsender,EventArgse){//初始化字体和文字大小默认值FontFamily[]fonts=FontFamily.Families;for(inti=0;i3、xt="宋体";toolStripComboBox2.SelectedText="10";}//////新建按钮点击事件/////////privatevoidtoolStripButton1_Click(objectsender,EventArgse){grid1.NewFile();grid1.DisplayRowNumber=true;grid1.Rows=20;grid1.Cols=10;}//////初始化Grid///<4、/summary>//////privatevoidgrid1_Load(objectsender,EventArgse){grid1.NewFile();grid1.DisplayRowNumber=true;grid1.Rows=25;//grid1.Range(1,1,grid1.Rows-1,grid1.Cols-1).Font=newFont("宋体",10);}//////保存按钮事件//////<5、/param>///privatevoidtoolStripButton3_Click(objectsender,EventArgse){if(grid1.ExportToExcel("")){MessageBox.Show("保存成功!");}}//////打开文件事件/////////privatevoidtoolStripButton2_Click(objectsender,EventArgse){6、stringcurr=System.IO.Directory.GetCurrentDirectory();grid1.OpenFile("");}//////单元格剪切/////////privatevoidtoolStripButton6_Click(objectsender,EventArgse){grid1.Selection.CutData();}//////复制//////7、der">///privatevoidtoolStripButton7_Click(objectsender,EventArgse){grid1.Selection.CopyData();}//////粘贴/////////priva
3、xt="宋体";toolStripComboBox2.SelectedText="10";}//////新建按钮点击事件/////////privatevoidtoolStripButton1_Click(objectsender,EventArgse){grid1.NewFile();grid1.DisplayRowNumber=true;grid1.Rows=20;grid1.Cols=10;}//////初始化Grid///<
4、/summary>//////privatevoidgrid1_Load(objectsender,EventArgse){grid1.NewFile();grid1.DisplayRowNumber=true;grid1.Rows=25;//grid1.Range(1,1,grid1.Rows-1,grid1.Cols-1).Font=newFont("宋体",10);}//////保存按钮事件//////<
5、/param>///privatevoidtoolStripButton3_Click(objectsender,EventArgse){if(grid1.ExportToExcel("")){MessageBox.Show("保存成功!");}}//////打开文件事件/////////privatevoidtoolStripButton2_Click(objectsender,EventArgse){
6、stringcurr=System.IO.Directory.GetCurrentDirectory();grid1.OpenFile("");}//////单元格剪切/////////privatevoidtoolStripButton6_Click(objectsender,EventArgse){grid1.Selection.CutData();}//////复制//////7、der">///privatevoidtoolStripButton7_Click(objectsender,EventArgse){grid1.Selection.CopyData();}//////粘贴/////////priva
7、der">///privatevoidtoolStripButton7_Click(objectsender,EventArgse){grid1.Selection.CopyData();}//////粘贴/////////priva
此文档下载收益归作者所有