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

首頁 > 編程 > C# > 正文

Winform讓DataGridView左側顯示圖片

2020-01-24 01:08:58
字體:
來源:轉載
供稿:網友

效果圖片

http://files.VeVB.COm/file_images/article/201605/2016530120101170.jpg

重寫DataGridView的OnRowPostPaint方法或者直接在DataGridView的RowPostPaint事件里寫,如下(重寫DataGridView的OnRowPostPaint方法)

using System;using System.Text;using System.Windows.Forms;using System.Drawing;namespace Test{  class DataGridViewEx : DataGridView  {    SolidBrush solidBrush;    public DataGridViewEx()    {      solidBrush = new SolidBrush(this.RowHeadersDefaultCellStyle.ForeColor);    }    protected override void OnRowPostPaint(DataGridViewRowPostPaintEventArgs e)    {      e.Graphics.DrawImage(Image對象, e.RowBounds.Location.X, e.RowBounds.Location.Y); base.OnRowPostPaint(e);    }  }}

以上就是重寫DataGridView的OnRowPostPaint方法,希望能給大家一個參考,也希望大家多多支持武林網。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 商南县| 灵丘县| 晋城| 新巴尔虎左旗| 德惠市| 龙井市| 沂源县| 阜宁县| 普定县| 呼图壁县| 界首市| 麻栗坡县| 波密县| 搜索| 连江县| 车致| 泽库县| 白银市| 宝应县| 南城县| 临邑县| 那坡县| 根河市| 宣汉县| 霞浦县| 周口市| 鹤壁市| 苍溪县| 盐山县| 乐安县| 平昌县| 防城港市| 思南县| 北票市| 辽阳县| 海盐县| 黄陵县| 林芝县| 东源县| 阳信县| 洪洞县|