日期:2014-05-18 浏览次数:21319 次
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("IEXPLORE.EXE", "http://www.baidu.com");
}
------解决方案--------------------
自己添加的,想触发什么事件都行
public class MyCtrl:Contrl
{
private ComboBox _cb = new ComboBox();
public event EventHandle AddItem;
protected virtural void OnAddItem(EventArgs e)
{
if(AddItem != null)
{
AddItem(this,e);
}
}
public void AddComboItem(string itemVal)
{
_cb.Items.Add(itemVal);
OnAddItem(new EventArgs());
}
}
------解决方案--------------------
什么方法,楼主可以公布一下吗?我的想法就是自定义一个控件,对ComboBox控件进行扩展,这样想怎么用就怎么用