• datagridview相关


    一、控制cell输入格式(整数为例)

            //private void dataGridView5_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
            //{
            //    if (dataGridView1.Rows[e.RowIndex].IsNewRow) return;
            //    int dci;
            //    if (e.ColumnIndex == 4 || e.ColumnIndex == 6 || e.ColumnIndex == 7)
            //    {
            //        if (e.FormattedValue != null && e.FormattedValue.ToString().Length > 0)
            //        {
            //            if (!int.TryParse(e.FormattedValue.ToString(), out dci) || dci < 0)
            //            {
            //                e.Cancel = true;
            //                MessageBox.Show("请输入整数", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //            }
            //        }
            //    }
            //}
  • 相关阅读:
    leetcode931
    leetcode1289
    leetcode1286
    poj Meteor Shower
    noip杂题题解
    noip2007部分题
    NOIP Mayan游戏
    某模拟题题解
    codevs 1423 骑士
    noip 邮票面值设计
  • 原文地址:https://www.cnblogs.com/ZGQ-VIP/p/13161593.html
Copyright © 2020-2023  润新知