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

首頁 > 編程 > C# > 正文

Winform讓DataGridView左側(cè)顯示圖片

2019-10-29 21:27:51
字體:
供稿:網(wǎng)友
本文主要介紹在如何讓DataGridView左側(cè)顯示圖片,這里主要講解重寫DataGridView的OnRowPostPaint方法,需要的朋友可以參考下。
 

效果圖片

Winform,DataGridView

重寫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方法,希望能給大家一個參考,也希望大家多多支持VEVB武林網(wǎng)。



注:相關(guān)教程知識閱讀請移步到c#教程頻道。
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 北安市| 阜南县| 阿巴嘎旗| 凤山县| 宜都市| 阿克苏市| 平武县| 类乌齐县| 奉化市| 西青区| 安丘市| 大名县| 监利县| 康平县| 台南县| 枣阳市| 通辽市| 两当县| 宕昌县| 华坪县| 铅山县| 靖安县| 景泰县| 芦溪县| 孝义市| 龙南县| 临武县| 武宣县| 长沙县| 白河县| 霍林郭勒市| 龙陵县| 潼关县| 昌图县| 嵊泗县| 化州市| 湘西| 西吉县| 田阳县| 呼玛县| 高唐县|