如何调出ColorPicker

Tangheng2002 2003-08-22 10:10:43
一般来说,在PropertyGrid上如果一个属性的类型是Color,那么点击下拉框的标记就可以弹出一个ColorPicker, 有三个TabPage,分别是Custom,Web和System。如果是想用在Form上,点击一个Button,也弹出一个ColorPicker,应该怎么做呢?大致上我想也许会用到UITypeEditor,可是我始终没找到ColorPicker这个系统控件。这样子我就僵在这个问题上了,不要告诉我自己做个类似的Control,我看到过SourceGrid控件中似乎找到方法来调出它,但是我没看明白。我只有50分可以给了,大家帮帮忙吧。
...全文
203 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lemong 2003-08-22
  • 打赏
  • 举报
回复
PropertyGrid propertyGrid1 = new PropertyGrid();
propertyGrid1.CommandsVisibleIfAvailable = true;
propertyGrid1.Location = new Point(10, 20);
propertyGrid1.Size = new System.Drawing.Size(400, 300);
propertyGrid1.TabIndex = 1;
propertyGrid1.Text = "Property Grid";

this.Controls.Add(propertyGrid1);

propertyGrid1.SelectedObject = label1;
lemong 2003-08-22
  • 打赏
  • 举报
回复
propertyGrid 大概可以
不过掉出来的东西太多,具体用法还得琢磨
Tangheng2002 2003-08-22
  • 打赏
  • 举报
回复
我刚想把我的帖子撤掉,你的速度真是快
不过回答就不对了
ColorDialog是个调色板
但我要的不过是个颜色选取器,是有不同的
TheAres 2003-08-22
  • 打赏
  • 举报
回复
用 System.Windows.Forms.ColorDialog

110,534

社区成员

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

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

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