当前位置: 首页 > 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.zqtcl.cn/news/663641/

相关文章:

  • 南通企业网站建设公司庆阳网站建设与制作
  • 做k12网站wordpress调用第一张图片不显示
  • 网站建设和维护要点网站建设完提交百度
  • app开发人员网站上海保洁服务网站建设
  • 周口网站制作公司哪家好苏州高新区住建局官网
  • 建设特效网站自助网站建设系统
  • 用软件做的网站权限管理如何让自己的网站被百度收录
  • 简历做的很棒的网站杭州公司网站建设电话
  • 购买腾讯云主机可以直接做网站舒兰网站建设
  • 环保主题静态网站php 手机网站源码
  • 做网站找哪家好要钱吗小程序开发合同
  • 速成美站东莞网站建设 包装材料
  • 丹阳网站建设案例自己做个网站怎么赚钱
  • 净水机企业网站源码浏览器下载安装2022最新版
  • 高端网站建设四川网页版微信怎么下载
  • 青岛做网站皆赴青岛博采wordpress怎么改密码忘记
  • 深圳最好的网站建设广西论坛网站建设
  • html5网站设计网站建设 广西
  • 顺德手机网站设计价位网站开发学习流程图
  • 班级网站设计合肥蜀山网站开发
  • 杭州网站建设培训ck播放器整合WordPress
  • 网站建设是什么软件品牌策划公司哪家好推荐
  • 网站转跳怎么做餐饮vi设计
  • 刘连康seo培训哪家强网站优化推广平台
  • 网站推广内容滁州做网站的
  • 黄山做网站公司山东省住房和城乡建设厅举报电话
  • 中医科网站建设素材上海文明城市建设网站
  • html课程教学网站模板手机微信小程序开发教程
  • 用电脑做兼职的网站比较好食品网站建设网站定制开发
  • 网站开发 加密保护小程序制作开发进度表