VS上,ListBox控件怎么没有Paint事件

sr22fcer2 2012-05-23 12:58:11
在VS编译器事件窗口,ListBox控件怎么没有Paint事件

http://msdn.microsoft.com/zh-cn/library/system.windows.forms.listbox.paint.aspx
...全文
154 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
熙风 2012-05-23
  • 打赏
  • 举报
回复

.NET Framework 版本有关
bdmh 2012-05-23
  • 打赏
  • 举报
回复
ListBox的OnPaint声明为



[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public event PaintEventHandler Paint;



不可见,自己继承一个吧
bonnibell 2012-05-23
  • 打赏
  • 举报
回复
那就自己定义一个


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class CustomControl1 :ListBox
{
public CustomControl1()
{
InitializeComponent();
}

protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
}
}
}


二号匪 2012-05-23
  • 打赏
  • 举报
回复
有 onItemPaint事件
cnfixit 2012-05-23
  • 打赏
  • 举报
回复
备注
此事件与该类无关。

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧