国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

DataGrid(WinForm)顯示行號最簡單的方法

2024-07-21 02:22:52
字體:
來源:轉載
供稿:網友
同樣是重載onpaint 方法,但是方法應該是比較巧妙的!而且不用擔心標題是不是有顯示,也不用去計算坐標,很方便的說!


protected override void onpaint(painteventargs e)
{
base.onpaint(e);

if(this.datasource!=null)
{
if( this.visiblerowcount == 0 )return;

rectangle currrct;

int irowcount = this.visiblerowcount;

string stext = "";

int nowy = 0;

for( int i = 0 ; i < irowcount ; i++ )
{
currrct = (rectangle)this.getcellbounds( i, 0 );
nowy = currrct.y + 2;
stext = string.format( " {0}", i+1 );
e.graphics.drawstring( stext, this.font, new solidbrush(color.black), 10, nowy );
}

}
}



  • 本文來源于網頁設計愛好者web開發社區http://www.html.org.cn收集整理,歡迎訪問。
  • 發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 临沧市| 茶陵县| 汨罗市| 名山县| 柏乡县| 北海市| 郑州市| 黄骅市| 莲花县| 建水县| 新河县| 科尔| 达拉特旗| 安福县| 云阳县| 高州市| 衡南县| 通州区| 南宁市| 中超| 亚东县| 岳阳市| 林芝县| 宿州市| 淮滨县| 临城县| 武强县| 调兵山市| 赞皇县| 高台县| 噶尔县| 桑植县| 樟树市| 新和县| 澄江县| 上思县| 柳州市| 金阳县| 上思县| 安陆市| 兴文县|