Thursday, June 9, 2011
翻墙与潜水: 免费试用PPTP/L2TP VPN-137VPN
翻墙与潜水: 免费试用PPTP/L2TP VPN-137VPN: "137VPN 现提供免费试用( 200M 流量)及付费 PPTP / L2TP VPN 服务( 加密 ),支持Windows、Mac OS、Linux、iPhone/iPad/iTouch、Android。 登陆 http://www.137vpn.com/trial.html..."
2011高考作文大串烧
离开那场高考已经8年了,但每次遇到6月7,8,9我都会去关注。特别喜欢关注作文题目。其实我最不擅长的是语文,确切点说是考语文。我一向热衷于写作但作文从来没及格过。哦,不对,应该是“我一向热衷于写作所以作文从来没及格过”。不管怎么样,高考都已经过了那么多年了,所谓过了就错了嘛。有些人虽然考不上但一直都重考,我觉得那是错了再继续错。
往年我都会拿上海卷的作文题目来写,但总觉得不够,因为有些地区的作文题不错,今年我选择了串烧。串烧是网络用语,但鉴于教育局不让用网络用语,我只能尽量在文中不用吧。其实政府机关和申报都用“神马”和“给力”了,这对于百姓很不公平,网络用语是我们发明的确只能给一群草泥马用。
我觉得从北京的考题说起比较公平,毕竟是我国首都嘛。如何看待乒乓球赛中国夺冠这个题目很自然让我联想到语文老师对我的抱怨,你数学考再高有何用,语文从来都不及格。如果将我的数学成绩比做中国乒乓球的国际成就的话那我的语文应该就是我国男足的世界第位了。老师说从最后一名提高10名是很容易的,但是从第3名提高到第2名是很困难的。但是经过多年对我国乒乓和男足的比较后我发觉保持第一名远比提高10名容易。2002年我们中国人兴奋了一回,我国男足还是被期待成长的。当年我们学校的政治选择题说中国男足进入世界杯复赛的内因是什么:A.我国男足实力增强了,B. 日韩是东道主不和我们争名额。我不敢选B,因为那样我要补考。不过能进复赛也是千年等一回,说明有进步,有进步需要保持,而要韩日每届世界杯都保持东道主是很困难的,于是2006年的那届我们还是没有保持复赛的资格。所以我国体育在世界上靠乒乓球拉点国际地位和我用数学来拉高考分数是很类似的。何乐而不为呢。
男足的进步缓慢至少证明我们很诚信,我们没有拿世界第二经济大国的钱去砸国际足联。我国经济的发展不能制造足球发展的假象。社会主义我们有的就是诚信,就像资本主义天天说自己有人权一样。有一次老外和我说他们国家有人权,他说人权是人最基本的权利,我说人民大会堂是人民的吗?他被问傻了,好吧,他承认人权不是人的基本权利。这是我国公民战胜资本主义国家公民的第一步。那个老外也知道我国初中生的数学课本到他们国家大学生都看不懂,所以他承认逻辑思维没我好。于是他开始夸奖我国的科技实力。他说“金盾”防火墙是他见过最含有科技实力的防火墙了,问我有没有个人版可以买,我说拔掉网线就可以体验到了,何必买呢。
其实这样的老外喜欢来挑衅我们中国人的还不少,在公司里有一个专门讨论魔兽世界的邮件群,那群美服的老外把最新的大灾变截图发出来,我们国服是有些悲哀,被问起你多少级了我们往往短人家一截。其实这句话是错误的,因为我们还有台服是与时俱进的,台服的更新速度几乎和美服一致,台湾是我国不可分割的一部分,这当然也算我们国服咯。其实我更喜欢说大陆服,台湾服,这样才能体现都是我国的嘛。当然大陆服和台服的版本号不一样,这个其实是一国两制的策略,让一部分人先玩起来,带动另一群人一起玩,这个符合大号带小号,强势群体带弱势群体的精神。不过大陆人民还是希望大陆服和台服可以有相同的版本号,一个版本号才能更好的体现一个中国的原则嘛。
玩魔兽的同时也增进了大陆人民和台湾人民的友谊。增进友谊让我们花费了大量的时间,大量的点卡,时间其实很宝贵的,每天都这样的流逝在了增进友谊上。不知不觉房价涨了,物价涨了,我们才发觉时间过去了。我们已经没法回到原点了。有些人说如果让我们回到原点,第一件事就是借钱买房。这样就不必为婚房范畴了。我说那你也该多结几次婚,结婚的价格也是涨的。人不能活在一种期待里,总是期待以后或者叹息现在,这样只能让时间流逝更快。看看镜子里的自己,还有多少时间可以用,一定要赶在时代的前面,千万不能来晚了,那样就惨了。
叹息今天的房价还是免了吧,一切都会过去的,过不去的也会过去的。2012会来的,房子会倒的,人民会团结起来上船的,地位差距会抚平的,只要海啸一来,核电站一炸,法西斯名族都会得到全球援助的。小日本也不会一直做经济老大,国际经济第二的位置没有保住,世界杯东道主也没有继续当,害得我国男足又不能出线。不过我国球迷还是很期待的,期待韩日再次当东道主。
写到此,我发觉我已经偏题了,这个作文肯定会算零分了,不过现在考个零分没人管我了,没人给我阅卷,我花费了我的时间来笑侃作文题也是一件乐事。孟子三乐说到君子有三乐,写写文章算是我的娱乐吧。以前我除了语文常年不及格外历史地理政治也从没及格过,也就等于说我文科没及格过,文科从来不及格的人喜欢以写文章为乐还是很正常的,著名作家哪个语文及格过啊。老师说多看新闻联播政治可以及格,我只能惭愧的说我还不如五杠哥,五杠哥2岁开始看新闻联播,这其实和2岁看A片没什么区别,都是看不懂。依目前的性教育要从幼儿园抓起来看,2岁看A片将成为现实。不过2岁看央视新闻联播还真的前无古人,后无来者。不过也说不定人家五杠哥真的是看了,不是炒作。凤姐可以看懂读者那五杠哥可以看懂新闻联播也正常了。
认真分析一下新闻联播也就典型3段式。1. 我国怎么怎么好,2. 人民生活多么好,3. 国外多么乱。这跟一家公司宣传自己的文化是差不多的,再垃圾的公司都会说我们公司怎么怎么好,员工发展怎么怎么好,其他公司不如我们。公司的意图旨在留人,国家的意图也旨在留人,但改国籍远比跳槽麻烦,你不可能因为美国待遇好明天就去美国面试,后天接了Offer向中国政府辞职。如果真这么容易的话中国也不会有13亿人口了。
当然不能说只有我们跳去国外,毕竟还有那么多外国人来我们中国了,虽然他们不愿意入我们国籍,但他们还是来了。来中国后他们发觉不能上Facebook了,不能Twitter了,不能用Gmail收发邮件了,但他们还是乐意在这个国家体验城管的威力,体验具有中国特色的低收入和高消费,体验到原来在中国70码可以开这么快。
最后也是我的一点期待吧,期待房价下降点,期待生活水平提高点,期待一个中国一个版本号,期待男足不要只靠韩日东道主去世界杯。相比最后一条我觉得我们更有动力去实现前面3条了。
Kira Qian
2011/6/7
往年我都会拿上海卷的作文题目来写,但总觉得不够,因为有些地区的作文题不错,今年我选择了串烧。串烧是网络用语,但鉴于教育局不让用网络用语,我只能尽量在文中不用吧。其实政府机关和申报都用“神马”和“给力”了,这对于百姓很不公平,网络用语是我们发明的确只能给一群草泥马用。
我觉得从北京的考题说起比较公平,毕竟是我国首都嘛。如何看待乒乓球赛中国夺冠这个题目很自然让我联想到语文老师对我的抱怨,你数学考再高有何用,语文从来都不及格。如果将我的数学成绩比做中国乒乓球的国际成就的话那我的语文应该就是我国男足的世界第位了。老师说从最后一名提高10名是很容易的,但是从第3名提高到第2名是很困难的。但是经过多年对我国乒乓和男足的比较后我发觉保持第一名远比提高10名容易。2002年我们中国人兴奋了一回,我国男足还是被期待成长的。当年我们学校的政治选择题说中国男足进入世界杯复赛的内因是什么:A.我国男足实力增强了,B. 日韩是东道主不和我们争名额。我不敢选B,因为那样我要补考。不过能进复赛也是千年等一回,说明有进步,有进步需要保持,而要韩日每届世界杯都保持东道主是很困难的,于是2006年的那届我们还是没有保持复赛的资格。所以我国体育在世界上靠乒乓球拉点国际地位和我用数学来拉高考分数是很类似的。何乐而不为呢。
男足的进步缓慢至少证明我们很诚信,我们没有拿世界第二经济大国的钱去砸国际足联。我国经济的发展不能制造足球发展的假象。社会主义我们有的就是诚信,就像资本主义天天说自己有人权一样。有一次老外和我说他们国家有人权,他说人权是人最基本的权利,我说人民大会堂是人民的吗?他被问傻了,好吧,他承认人权不是人的基本权利。这是我国公民战胜资本主义国家公民的第一步。那个老外也知道我国初中生的数学课本到他们国家大学生都看不懂,所以他承认逻辑思维没我好。于是他开始夸奖我国的科技实力。他说“金盾”防火墙是他见过最含有科技实力的防火墙了,问我有没有个人版可以买,我说拔掉网线就可以体验到了,何必买呢。
其实这样的老外喜欢来挑衅我们中国人的还不少,在公司里有一个专门讨论魔兽世界的邮件群,那群美服的老外把最新的大灾变截图发出来,我们国服是有些悲哀,被问起你多少级了我们往往短人家一截。其实这句话是错误的,因为我们还有台服是与时俱进的,台服的更新速度几乎和美服一致,台湾是我国不可分割的一部分,这当然也算我们国服咯。其实我更喜欢说大陆服,台湾服,这样才能体现都是我国的嘛。当然大陆服和台服的版本号不一样,这个其实是一国两制的策略,让一部分人先玩起来,带动另一群人一起玩,这个符合大号带小号,强势群体带弱势群体的精神。不过大陆人民还是希望大陆服和台服可以有相同的版本号,一个版本号才能更好的体现一个中国的原则嘛。
玩魔兽的同时也增进了大陆人民和台湾人民的友谊。增进友谊让我们花费了大量的时间,大量的点卡,时间其实很宝贵的,每天都这样的流逝在了增进友谊上。不知不觉房价涨了,物价涨了,我们才发觉时间过去了。我们已经没法回到原点了。有些人说如果让我们回到原点,第一件事就是借钱买房。这样就不必为婚房范畴了。我说那你也该多结几次婚,结婚的价格也是涨的。人不能活在一种期待里,总是期待以后或者叹息现在,这样只能让时间流逝更快。看看镜子里的自己,还有多少时间可以用,一定要赶在时代的前面,千万不能来晚了,那样就惨了。
叹息今天的房价还是免了吧,一切都会过去的,过不去的也会过去的。2012会来的,房子会倒的,人民会团结起来上船的,地位差距会抚平的,只要海啸一来,核电站一炸,法西斯名族都会得到全球援助的。小日本也不会一直做经济老大,国际经济第二的位置没有保住,世界杯东道主也没有继续当,害得我国男足又不能出线。不过我国球迷还是很期待的,期待韩日再次当东道主。
写到此,我发觉我已经偏题了,这个作文肯定会算零分了,不过现在考个零分没人管我了,没人给我阅卷,我花费了我的时间来笑侃作文题也是一件乐事。孟子三乐说到君子有三乐,写写文章算是我的娱乐吧。以前我除了语文常年不及格外历史地理政治也从没及格过,也就等于说我文科没及格过,文科从来不及格的人喜欢以写文章为乐还是很正常的,著名作家哪个语文及格过啊。老师说多看新闻联播政治可以及格,我只能惭愧的说我还不如五杠哥,五杠哥2岁开始看新闻联播,这其实和2岁看A片没什么区别,都是看不懂。依目前的性教育要从幼儿园抓起来看,2岁看A片将成为现实。不过2岁看央视新闻联播还真的前无古人,后无来者。不过也说不定人家五杠哥真的是看了,不是炒作。凤姐可以看懂读者那五杠哥可以看懂新闻联播也正常了。
认真分析一下新闻联播也就典型3段式。1. 我国怎么怎么好,2. 人民生活多么好,3. 国外多么乱。这跟一家公司宣传自己的文化是差不多的,再垃圾的公司都会说我们公司怎么怎么好,员工发展怎么怎么好,其他公司不如我们。公司的意图旨在留人,国家的意图也旨在留人,但改国籍远比跳槽麻烦,你不可能因为美国待遇好明天就去美国面试,后天接了Offer向中国政府辞职。如果真这么容易的话中国也不会有13亿人口了。
当然不能说只有我们跳去国外,毕竟还有那么多外国人来我们中国了,虽然他们不愿意入我们国籍,但他们还是来了。来中国后他们发觉不能上Facebook了,不能Twitter了,不能用Gmail收发邮件了,但他们还是乐意在这个国家体验城管的威力,体验具有中国特色的低收入和高消费,体验到原来在中国70码可以开这么快。
最后也是我的一点期待吧,期待房价下降点,期待生活水平提高点,期待一个中国一个版本号,期待男足不要只靠韩日东道主去世界杯。相比最后一条我觉得我们更有动力去实现前面3条了。
Kira Qian
2011/6/7
Saturday, October 25, 2008
DataGridView prevent digital colum from inputting non-digital character
When you input some non-digital character into a cell of a digital column in DataGridView, it will raise a DataError dialog with rather long error message. That is not satisfy because it doesn’t tell us what is wrong directly. Some people think of overriding the OnDataError method to check by ourself and give out friendly message. That’s a great idea. But I have a better solution which can prevent user from typing non-digital character into a cell of a digital column. So let’s begin our tour.
My solution also need to create custom DataGridView derive from System.Windows.Forms.DataGridView. One of the most important event of DataGridView is EditingControlShowing. It occurs when a control for editing a cell is showing. I can get the TextBox control of a cell and to use the same way as preventing TextBox from inputting non-digital character.
Code of MyDataGridView
public class MyDataGridView : DataGridView
{
public MyDataGridView()
{
this.EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(MyDataGridView_EditingControlShowing);
}
void MyDataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (this.CurrentCell.ValueType == typeof(int))
{
TextBox textBoxCell = e.Control as TextBox;
if (textBoxCell != null)
{
textBoxCell.KeyPress += new KeyPressEventHandler(textBoxCell_KeyPress);
}
}
}
void textBoxCell_KeyPress(object sender, KeyPressEventArgs e)
{
if (!Char.IsDigit(e.KeyChar))
{
e.Handled = true;
}
else
{
e.Handled = false;
}
}
}
First I need to judge if the editing cell is a digital cell, so I use “if (this.CurrentCell.ValueType == typeof(int))”. If it is a digital cell, then I need to handle the KeyPress event of TextBox to hang the non-digital character typing.
Let’s test the solution in a Windows Forms application.
First drag a MyDataGridView from the ToolBox to the form. You can create a DataTable as its datasource and add one digital column and a string column to the datasource.
Code like this
public partial class Form1 : Form
{
private DataTable sourceTable;
public Form1()
{
InitializeComponent();
sourceTable = new DataTable();
sourceTable.Columns.Add("IntColumn", typeof(int));
sourceTable.Columns.Add("StringColumn", typeof(string));
sourceTable.Rows.Add(1, "test1");
sourceTable.Rows.Add(2, "test2");
sourceTable.Rows.Add(3, "test3");
myDataGridView1.DataSource = sourceTable;
}
}
After that run the application, You will find that it is not allowed to type any non-digital character into the cell of “IntColumn”.
My solution also need to create custom DataGridView derive from System.Windows.Forms.DataGridView. One of the most important event of DataGridView is EditingControlShowing. It occurs when a control for editing a cell is showing. I can get the TextBox control of a cell and to use the same way as preventing TextBox from inputting non-digital character.
Code of MyDataGridView
public class MyDataGridView : DataGridView
{
public MyDataGridView()
{
this.EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(MyDataGridView_EditingControlShowing);
}
void MyDataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (this.CurrentCell.ValueType == typeof(int))
{
TextBox textBoxCell = e.Control as TextBox;
if (textBoxCell != null)
{
textBoxCell.KeyPress += new KeyPressEventHandler(textBoxCell_KeyPress);
}
}
}
void textBoxCell_KeyPress(object sender, KeyPressEventArgs e)
{
if (!Char.IsDigit(e.KeyChar))
{
e.Handled = true;
}
else
{
e.Handled = false;
}
}
}
First I need to judge if the editing cell is a digital cell, so I use “if (this.CurrentCell.ValueType == typeof(int))”. If it is a digital cell, then I need to handle the KeyPress event of TextBox to hang the non-digital character typing.
Let’s test the solution in a Windows Forms application.
First drag a MyDataGridView from the ToolBox to the form. You can create a DataTable as its datasource and add one digital column and a string column to the datasource.
Code like this
public partial class Form1 : Form
{
private DataTable sourceTable;
public Form1()
{
InitializeComponent();
sourceTable = new DataTable();
sourceTable.Columns.Add("IntColumn", typeof(int));
sourceTable.Columns.Add("StringColumn", typeof(string));
sourceTable.Rows.Add(1, "test1");
sourceTable.Rows.Add(2, "test2");
sourceTable.Rows.Add(3, "test3");
myDataGridView1.DataSource = sourceTable;
}
}
After that run the application, You will find that it is not allowed to type any non-digital character into the cell of “IntColumn”.
Make a runtime moveable control
It is amazing to move the controls on a form to everwhere of the form. Some one might think of handling the MouseDown event of a control and to reset its Location property to implement this goal. I used to hold the same thought. But the fact told me that this solution was not satisfy. The control could not be moved smoothly. To make the solution perfectly, I came to use Win32 API at the end.
In this solution, I chose to use two API, ReleaseCapture and SendMessage which located in User32.dll. Before I used these API, I should first using the namespace System.Runtime.InteropServices. The System.Runtime.InteropServices namespace provides a wide variety of members that support COM interop and platform invoke services.
Here is the code of a Runtime moveable Panel
public class MoveablePanel : Panel
{
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HTCAPTION = 0x2;
[DllImport("User32.dll")]
public static extern bool ReleaseCapture();
[DllImport("User32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
private bool _enableRuntimeMoveable;
public MoveablePanel()
{
_enableRuntimeMoveable = false;
this.MouseDown += new MouseEventHandler(MoveablePanel_MouseDown);
}
void MoveablePanel_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left && _enableRuntimeMoveable == true)
{
ReleaseCapture();
SendMessage(this.Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
}
}
public bool EnableRuntimeMoveable
{
get { return _enableRuntimeMoveable; }
set { _enableRuntimeMoveable = value; }
}
}
In this example, I have handled the MouseDown event to call ReleaseCapture and SendMessage method. The first parameter of SendMessage method is the Hanle of the control that will be move. The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. Also I have created a property named EnableRuntimeMoveable in the MoveablePanel, when you want this panel moveable, you can set the value to true. Otherwise you can set it to false then it is a normal panel.
Let’s create a moveable Panel and test it.
public partial class Form1 : Form
{
private MoveablePanel moveablePanel;
public Form1()
{
InitializeComponent();
moveablePanel = new MoveablePanel();
moveablePanel.Location = new Point(10, 10);
moveablePanel.BorderStyle = BorderStyle.Fixed3D;
moveablePanel.BackColor = Color.YellowGreen;
moveablePanel.EnableRuntimeMoveable = true;
this.Controls.Add(moveablePanel);
}
}
In order to see the panel clearly, I have set its background color to yellow green. Then you can enjoy moving it. You can create your own runtime moveable control such as TextBox, ComboBox, DataGridView etc. in this way.
In this solution, I chose to use two API, ReleaseCapture and SendMessage which located in User32.dll. Before I used these API, I should first using the namespace System.Runtime.InteropServices. The System.Runtime.InteropServices namespace provides a wide variety of members that support COM interop and platform invoke services.
Here is the code of a Runtime moveable Panel
public class MoveablePanel : Panel
{
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HTCAPTION = 0x2;
[DllImport("User32.dll")]
public static extern bool ReleaseCapture();
[DllImport("User32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
private bool _enableRuntimeMoveable;
public MoveablePanel()
{
_enableRuntimeMoveable = false;
this.MouseDown += new MouseEventHandler(MoveablePanel_MouseDown);
}
void MoveablePanel_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left && _enableRuntimeMoveable == true)
{
ReleaseCapture();
SendMessage(this.Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
}
}
public bool EnableRuntimeMoveable
{
get { return _enableRuntimeMoveable; }
set { _enableRuntimeMoveable = value; }
}
}
In this example, I have handled the MouseDown event to call ReleaseCapture and SendMessage method. The first parameter of SendMessage method is the Hanle of the control that will be move. The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. Also I have created a property named EnableRuntimeMoveable in the MoveablePanel, when you want this panel moveable, you can set the value to true. Otherwise you can set it to false then it is a normal panel.
Let’s create a moveable Panel and test it.
public partial class Form1 : Form
{
private MoveablePanel moveablePanel;
public Form1()
{
InitializeComponent();
moveablePanel = new MoveablePanel();
moveablePanel.Location = new Point(10, 10);
moveablePanel.BorderStyle = BorderStyle.Fixed3D;
moveablePanel.BackColor = Color.YellowGreen;
moveablePanel.EnableRuntimeMoveable = true;
this.Controls.Add(moveablePanel);
}
}
In order to see the panel clearly, I have set its background color to yellow green. Then you can enjoy moving it. You can create your own runtime moveable control such as TextBox, ComboBox, DataGridView etc. in this way.
Friday, October 24, 2008
How to draw a color list ComboBox

In Windows Forms project, ComboBox is one of the most common controls that we have ever used. Microsoft .Net control library offers a lot of events and methods that let you custom your own control’s UI as well as its function. Now I want to introduce you a way to custom a color ComboBox which can show you a colorful dropdown list.
In this example, first you should set the DrawMode property of your ComboBox to DrawMode.OwnerDrawFixed and DropDownStyle property to ComboBoxStyle.DropDownList. Then you can handle the DrawItem event to draw each item base on the ColorList (a list which contain all color you want to draw).
Here is the code of your color list ComboBox
public class ColorComboBox : System.Windows.Forms.ComboBox
{
private List< Color > _colorList;
public ColorComboBox()
{
_colorList = new List< Color >();
this.DrawMode = DrawMode.OwnerDrawFixed;
this.DropDownStyle = ComboBoxStyle.DropDownList;
this.DrawItem += new DrawItemEventHandler(ColorComboBox_DrawItem);
}
public ColorComboBox(List< Color > colorList)
{
_colorList = colorList;
this.DrawMode = DrawMode.OwnerDrawFixed;
this.DropDownStyle = ComboBoxStyle.DropDownList;
for (int i = 0; i < colorList.Count; i++)
{
this.Items.Add("");
}
this.SelectedIndex = 0;
this.DrawItem += new DrawItemEventHandler(ColorComboBox_DrawItem);
}
void ColorComboBox_DrawItem(object sender, DrawItemEventArgs e)
{
if (e.Index >= 0)
{
Graphics g = e.Graphics;
Brush brush = new SolidBrush(_colorList[e.Index]);
Rectangle rec = e.Bounds;
g.FillRectangle(brush, rec);
}
}
public List< Color > ColorList
{
get { return _colorList; }
set
{
_colorList = value;
for (int i = 0; i < _colorList.Count; i++)
{
this.Items.Add("");
}
this.SelectedIndex = 0;
}
}
}
Let us test it on a Windows Form application
public partial class Form1 : Form
{
private ColorComboBox colorCmb;
public Form1()
{
InitializeComponent();
List< Color > colorList = new List< Color >();
colorList.Add(Color.Black);
colorList.Add(Color.Blue);
colorList.Add(Color.Yellow);
colorList.Add(Color.Green);
colorList.Add(Color.Red);
colorList.Add(Color.Pink);
colorCmb = new ColorComboBox();
colorCmb.ColorList = colorList;
colorCmb.Location = new Point(50, 50);
this.Controls.Add(colorCmb);
}
}
Then you can run your code to see the effect. Click the dropdown button of that ComboBox, you can see the color that we have put in the ColorList. Wish you can enjoy this.
Subscribe to:
Posts (Atom)