| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1116 人关注过本帖
标题:请求解决问题!
只看楼主 加入收藏
chenweichao2010
Rank: 1
等 级:新手上路
帖 子:31
专家分:0
注 册:2008-10-19
收藏
 问题点数:0 回复次数:7 
请求解决问题!
我想在
private void textBox1_TextChanged(object sender, EventArgs e){}
事件中调用
private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e){}
这个事件,怎样实现啊?急!!
搜索更多相关主题的帖子: 请求 
2008-10-20 22:34
ecjob
Rank: 3Rank: 3
等 级:论坛游侠
威 望:8
帖 子:321
专家分:110
注 册:2006-10-15
收藏
得分:0 
private void textBox1_TextChanged(object sender, EventArgs e){
dataGridView1_CellMouseDoubleClick(null,null)
}

[[it] 本帖最后由 ecjob 于 2008-10-20 22:39 编辑 [/it]]

86年出生,广东求 女人/项目/工作 ,见广告即有效.论坛PM
2008-10-20 22:37
乖老鼠
Rank: 5Rank: 5
来 自:四川省
等 级:职业侠客
威 望:2
帖 子:434
专家分:394
注 册:2008-9-8
收藏
得分:0 
LS是对的

也可以:dataGridView1_CellMouseDoubleClick(new object(), new DataGridViewCellMouseEventArgs())

转眼就从编程菜鸟混成了半灌水
2008-10-21 08:56
chenweichao2010
Rank: 1
等 级:新手上路
帖 子:31
专家分:0
注 册:2008-10-19
收藏
得分:0 
上面两位大侠,好像两种方法都不能解决啊!能明确一点吗?谢谢
2008-10-21 12:15
乖老鼠
Rank: 5Rank: 5
来 自:四川省
等 级:职业侠客
威 望:2
帖 子:434
专家分:394
注 册:2008-9-8
收藏
得分:0 
[bo][un]chenweichao2010[/un] 在 2008-10-21 12:15 的发言:[/bo]

上面两位大侠,好像两种方法都不能解决啊!能明确一点吗?谢谢

都不能解决?这不可能哦~~~

是你的dataGridView1_CellMouseDoubleClick里面没写代码吧…所以调用了没调用没区别

你设置个断点,然后单步执行,看进去没

[[it] 本帖最后由 乖老鼠 于 2008-10-21 12:50 编辑 [/it]]

转眼就从编程菜鸟混成了半灌水
2008-10-21 12:49
chenweichao2010
Rank: 1
等 级:新手上路
帖 子:31
专家分:0
注 册:2008-10-19
收藏
得分:0 
请求各位给我解答一下!(事件调用)
private void txtInput_TextChanged(object sender, EventArgs e)
        {
            String strInput = txtInput.Text.ToString().Trim();
            SqlConnection myConnection = new SqlConnection

("server=localhost;database=ProductData;Trusted_Connection=yes;user id=;password=");
            SqlDataAdapter orderdet = new SqlDataAdapter("select

pId,pName,pModel,pUnit,pColor,pPurchasePrice,pMinAmount from Product where pId like '%" +

strInput + "%' or pName like '%" + strInput + "%'", myConnection);
            DataTable dt = new DataTable();
            orderdet.Fill(dt);
            dataProductBill.DataSource = dt.DefaultView;
            //dataProductBill_CellMouseDoubleClick(dataProductBill,);
        //想在这里调用dataProductBill_CellMouseDoubleClick()这个事件,但是总是报参数出错!
        }




   private void dataProductBill_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                //获取DataGirdView中的值
                String strId = dataProductBill.CurrentRow.Cells["pId"].Value.ToString();
                String strName = dataProductBill.CurrentRow.Cells["pName"].Value.ToString();
                String strModel = dataProductBill.CurrentRow.Cells["pModel"].Value.ToString();
                String strUnit = dataProductBill.CurrentRow.Cells["pUnit"].Value.ToString();
                String strColor = dataProductBill.CurrentRow.Cells["pColor"].Value.ToString();
                String strPuchasePrice = dataProductBill.CurrentRow.Cells["pConsultPrice"].Value.ToString();
                String strMinAmount = dataProductBill.CurrentRow.Cells["pMinAmount"].Value.ToString();
                String strManufacturer = dataProductBill.CurrentRow.Cells["pManufacturer"].Value.ToString();
                String strRemark = dataProductBill.CurrentRow.Cells["pRemark"].Value.ToString();
                FrmProductInfo fr = new FrmProductInfo(strId, strName, strModel, strUnit, strColor, strPuchasePrice, strMinAmount, strManufacturer, strRemark);
                fr.Owner = this;               
                fr.ShowDialog();
                label3.Text = strContent.ToString ();
                label4.Text = strName;
                label5.Text = strName1;               
                fr.Dispose();
                fillData();         
            }
            catch
            {
                MessageBox.Show("没有可选商品!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
2008-10-21 19:29
乖老鼠
Rank: 5Rank: 5
来 自:四川省
等 级:职业侠客
威 望:2
帖 子:434
专家分:394
注 册:2008-9-8
收藏
得分:0 
dataProductBill_CellMouseDoubleClick(null,null)怎么会出错哦

转眼就从编程菜鸟混成了半灌水
2008-10-22 08:37
chenweichao2010
Rank: 1
等 级:新手上路
帖 子:31
专家分:0
注 册:2008-10-19
收藏
得分:0 
[bo][un]乖老鼠[/un] 在 2008-10-22 08:37 的发言:[/bo]

dataProductBill_CellMouseDoubleClick(null,null)怎么会出错哦




谢谢你的指教,可是当我加入dataProductBill_CellMouseDoubleClick(null,null)的时候,这个事件还是没有反应的,可能是参数的问题吧!
2008-10-22 12:24
快速回复:请求解决问题!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.032461 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved