国产探花免费观看_亚洲丰满少妇自慰呻吟_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收集整理,歡迎訪問。
  • 發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 青阳县| 呼伦贝尔市| 大悟县| 札达县| 许昌县| 沾化县| 汨罗市| 昌吉市| 宜城市| 冕宁县| 南丰县| 蓬安县| 玉树县| 平果县| 丹棱县| 应城市| 壶关县| 沙湾县| 邳州市| 澎湖县| 绍兴县| 巴楚县| 晋城| 营口市| 洛隆县| 安达市| 罗甸县| 西藏| 平阴县| 远安县| 天峻县| 资阳市| 宜宾县| 卢湾区| 大港区| 潮州市| 竹北市| 藁城市| 吴堡县| 山丹县| 邮箱|