zoukankan      html  css  js  c++  java
  • windows mobile datagrid 样式

    dgContact.PreferredRowHeight = 30; //Datagrid 行的高度

    for(int   i   =   0   ;   i   <   this.dataGrid1.VisibleRowCount   -   1   ;   i   ++)
    {
          //填充cell的边界色
          e.Graphics.DrawRectangle(new   Pen(Color.Red),dataGrid1.GetCellBounds(i,2));
          //填充cell格的颜色
          e.Graphics.FillRectangle(Brushes.Beige,dataGrid1.GetCellBounds(i,2));
    }

     private void dgContact_Paint(object sender, PaintEventArgs e)
            {
                DataGrid dg = (DataGrid)sender;
                if (dg.DataSource != null)
                {
                    if (dg.VisibleRowCount == 0) return;
                    Rectangle currRct;
                    int iRowCount = dg.VisibleRowCount;
                    string sText = "";
                    int nowY = 0;
                    for (int i = 0; i < iRowCount; i++)
                    {
                        currRct = (Rectangle)dg.GetCellBounds(i, 0);
                        nowY = currRct.Y + 2;
                        sText = string.Format(" {0}", i + 1);
                        e.Graphics.DrawString(sText, dg.Font, new SolidBrush(Color.Black), 10, nowY);
                    }
                }
            }

    参考来源:http://topic.csdn.net/t/20060914/17/5022713.htmls

    paint方法里面
    int   i   ;
    for   (i   =   0;   i   <     dataGrid1.VisibleRowCount;i++){
    string   temp     =   dataGrid1[i,3].ToString()   ;
    e.Graphics.FillRectangle(Brushes.Red,   dataGrid1.GetCellBounds(i,   3));
    e.Graphics.DrawString(temp,   dataGrid1.Font,   Brushes.Black,   dataGrid1.GetCellBounds(i,   3).Left   +   2,   dataGrid1.GetCellBounds(i,   3).Top   +   2);
    }

  • 相关阅读:
    python全局变量与局部变量
    TCP的三次握手四次挥手
    关于Http的面试题
    HSTS
    关于网络安全攻防知识
    http详解
    python中的f''、b''、u''、r''
    常见SQL Server导入导出数据的几个工具
    chrome浏览器中 F12 功能的简单介绍
    Sqlcmd使用详解
  • 原文地址:https://www.cnblogs.com/doubleyong/p/2245000.html
Copyright © 2011-2022 走看看