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);
    }

  • 相关阅读:
    人与人之间的本质
    如何让百度搜索不到
    js.prototype最深刻的理解
    调用函数不能用&
    浏览器的缓存就是关闭了浏览器任然存在
    Spring switch的使用
    thymeleaf如何遍历数据 each循环的使用
    spring 机制 扫描包
    Spring分层次建包
    如何使用thymeleaf显示控制传递过来的数据
  • 原文地址:https://www.cnblogs.com/doubleyong/p/2245000.html
Copyright © 2011-2022 走看看