当前位置: 首页 > news >正文

做网站 需要工信部备案吗杭州建设教育网站

做网站 需要工信部备案吗,杭州建设教育网站,怎么制作一个游戏app,导购网站模板免费下载目的#xff1a; 扩展 C# WinForm 自带的表格控件#xff0c;使其可以自动判断数据的上下界限值#xff0c;并标识溢出。 这里使用的方法是#xff1a;扩展 表格的列 对象#xff1a;DataGridViewColumn。 1.创建类#xff1a;DataGridViewDecimalCheckCell.cs public cl…目的 扩展 C# WinForm 自带的表格控件使其可以自动判断数据的上下界限值并标识溢出。 这里使用的方法是扩展 表格的列 对象DataGridViewColumn。 1.创建类DataGridViewDecimalCheckCell.cs public class DataGridViewDecimalCheckCell : DataGridViewTextBoxCell{private bool checkMaxValue false;private bool checkMinValue false;private decimal maxValue 0;private decimal minValue 0;public decimal MaxValue{get { return maxValue; }internal set { maxValue value; }}public decimal MinValue{get { return minValue; }internal set { minValue value; }}public bool CheckMaxValue{get { return checkMaxValue; }internal set { checkMaxValue value; }}public bool CheckMinValue{get { return checkMinValue; }internal set{checkMinValue value;}}public override object Clone(){DataGridViewDecimalCheckCell c base.Clone() as DataGridViewDecimalCheckCell;c.checkMaxValue this.checkMaxValue;c.checkMinValue this.checkMinValue;c.maxValue this.maxValue;c.minValue this.minValue;return c;}protected override void Paint(Graphics graphics, Rectangle clipBounds,Rectangle cellBounds, int rowIndex, DataGridViewElementStates cellState,object value, object formattedValue, string errorText,DataGridViewCellStyle cellStyle,DataGridViewAdvancedBorderStyle advancedBorderStyle,DataGridViewPaintParts paintParts){// Paint the base contentbase.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState,value, formattedValue, errorText, cellStyle,advancedBorderStyle, paintParts);// 上下界限溢出判断if (rowIndex 0 || this.OwningRow.IsNewRow) // 行序号不为-1且不是新记录行return;if (value null) return;if (value.GetType() typeof(DBNull)) return;decimal vCurValue Convert.ToDecimal(value);bool overValue false;Image img null;if (checkMaxValue){overValue vCurValue maxValue;img VsTest.Properties.Resources.Undo;}if (checkMinValue !overValue){overValue vCurValue minValue;img VsTest.Properties.Resources.Redo;}// 将图片绘制在 数值文本后面if (overValue img ! null){var vSize graphics.MeasureString(vCurValue.ToString(), cellStyle.Font);System.Drawing.Drawing2D.GraphicsContainer container graphics.BeginContainer();graphics.SetClip(cellBounds);graphics.DrawImageUnscaled(img, new Point(cellBounds.Location.X (int)vSize.Width, cellBounds.Location.Y));graphics.EndContainer(container);}}protected override bool SetValue(int rowIndex, object value){if (rowIndex 0){try{decimal vdeci Convert.ToDecimal(value); // 筛选非数字base.ErrorText string.Empty;}catch (Exception ex){base.ErrorText 输入错误 ex.Message;return false;}}return base.SetValue(rowIndex, value);}} 2.创建类DataGridViewDecimalCheckColumn.cs public class DataGridViewDecimalCheckColumn : DataGridViewColumn{private bool checkMaxValue false;private bool checkMinValue false;private decimal maxValue 0;private decimal minValue 0;public decimal MaxValue{get { return maxValue; }set{maxValue value;(base.CellTemplate as DataGridViewDecimalCheckCell).MaxValue value;}}public decimal MinValue{get { return minValue; }set{minValue value;(base.CellTemplate as DataGridViewDecimalCheckCell).MinValue value;}}/// summary/// 是否对值上界限进行检查与MaxValue配合使用/// /summarypublic bool CheckMaxValue{get { return checkMaxValue; }set{checkMaxValue value;(base.CellTemplate as DataGridViewDecimalCheckCell).CheckMaxValue value;}}/// summary/// 是否对值下界限进行检查与MinValue配合使用/// /summarypublic bool CheckMinValue{get { return checkMinValue; }set{checkMinValue value;(base.CellTemplate as DataGridViewDecimalCheckCell).CheckMinValue value;}}public DataGridViewDecimalCheckColumn(): base(new DataGridViewDecimalCheckCell()){}public override object Clone(){DataGridViewDecimalCheckColumn c base.Clone() as DataGridViewDecimalCheckColumn;c.checkMaxValue this.checkMaxValue;c.checkMinValue this.checkMinValue;c.maxValue this.maxValue;c.minValue this.minValue;return c;}} 3.现在就可以使用了在窗体上拖一个 dataGridView 控件添加如下代码 private void TestForm_Load(object sender, EventArgs e){InitControlsProperties(); // 初始化// 绑定数据DataTable dTabel new DataTable();dTabel.Columns.Add(ID,typeof(int));dTabel.Columns.Add(TestValue,typeof(decimal));Random rnd new Random();for (int i 0; i 10; i) // 随机10个数{var vdr dTabel.NewRow();vdr[0] i 1;vdr[1] rnd.Next(50);dTabel.Rows.Add(vdr);}this.dataGridView1.DataSource dTabel;}private void InitControlsProperties(){var vColumnID new DataGridViewDecimalCheckColumn();vColumnID.DataPropertyName ID;vColumnID.DefaultCellStyle.Alignment DataGridViewContentAlignment.MiddleLeft;vColumnID.Name ID;vColumnID.HeaderText 序号;vColumnID.Width 50;this.dataGridView1.Columns.Add(vColumnID);var vColumnValue new DataGridViewDecimalCheckColumn();vColumnValue.DataPropertyName TestValue;vColumnValue.DefaultCellStyle.Alignment DataGridViewContentAlignment.MiddleLeft;vColumnValue.Name TestValue;vColumnValue.HeaderText 测试数据;vColumnValue.Width 100;vColumnValue.CheckMaxValue true; // 进行最大值检查vColumnValue.MaxValue 41;vColumnValue.CheckMinValue true; // 进行最小值检查vColumnValue.MinValue 7;this.dataGridView1.Columns.Add(vColumnValue);//this.dataGridView1.AllowUserToAddRows false;//this.dataGridView1.AllowUserToDeleteRows false;//this.dataGridView1.ReadOnly true;this.dataGridView1.AutoGenerateColumns false;} 效果图    [http://www.cnblogs.com/CUIT-DX037/]  转载于:https://www.cnblogs.com/CUIT-DX037/p/7354057.html
http://www.pierceye.com/news/663641/

相关文章:

  • 腾讯建设网站首页做销售网站
  • 推广引流网站聚名网注册
  • 原来做网站后来跑国外了多伦多网站建设多少钱
  • 手机建站平台做母婴网站设计思路
  • 免费个人手机网站九八智能建站
  • 中山网站备案如何做购物网站
  • 常见的简单的网站制作建设网站的好公司
  • 邯郸网站制作建设wordpress+怎么迁移
  • 设计创意广告上海企业网站优化
  • 自己做网站需要购买服务器吗WordPress文章相册修改
  • 校园招聘哪个网站做的好学做川菜网站
  • 大足网站建设公司医院网站建设熊掌号
  • 做网站编辑是不是也要做推广做蛋白go分析网站
  • 免费品牌网站制作云南电商网站建设
  • 宿迁莱布拉网站建设常州做网站建设的公司
  • 广东网站建站系统哪家好常州网站搭建公司
  • 400网站建设推广软件工程师工资
  • 专门做正品的网站手机版深圳市门户网站建设怎么样
  • 做外贸比较好的网站有哪些北京短视频代运营
  • 建站公司学习筑梦网站建设
  • 手工艺品网站建设侧胡顺个人简历表格可填写
  • 电商网站竞价推广策略淘宝做问卷的网站
  • 门窗 东莞网站建设婚庆公司收费标准
  • 网站页面下沉的特效代码网络建设存在的问题
  • 给网站做维护是什么工作网页怎么赚钱
  • 三丰云做游戏网站win主机安装wordpress
  • 网站建设黄荣vuejs做视频网站设计
  • 手机怎样下载安装建设银行网站企业通过网络推广成功的案例
  • 门户网站开发工具软件哪个公司的网络最好用
  • 河南省住房和城乡建设厅查询网站首页舆情网站推荐