惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
B
Blog RSS Feed
阮一峰的网络日志
阮一峰的网络日志
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
MyScale Blog
MyScale Blog
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
Martin Fowler
Martin Fowler
Vercel News
Vercel News
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
Last Week in AI
Last Week in AI
Hugging Face - Blog
Hugging Face - Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
云风的 BLOG
云风的 BLOG

博客园 - 阮

Database access assembly build program. - 阮 Remoting: Server encountered an internal error. - 阮 昨天忽然发现被加到training团队中了,遂来发一篇。 利用Brush修改图片,并写入Response一例(网上BBS中贴可变文字图片的例子)。 Avalon 与 3D。 关于QQ的临时消息 Google Search for dot net nuke. 初识 Avalon 通过程序控制Windows传真发送。 VRML Merry Chirstmas. 继续昨天的问题。 What's wrong? 构建安全的 ASP.NET 应用程序。(转) Google search for DNN 终于写完了。 DataGrid不能绑定Field? 试了试Dot Net Nuke还真爽。 取得天气的WEB地址,weather.com 终于,从System.Windows.Forms.Control继承了一下。
检测Win Form Datagrid点击cell值的代码,from msdn。
· 2004-12-09 · via 博客园 - 阮

protected void dataGrid1_MouseDown(object sender, MouseEventArgs e){
   
// Use the HitTest method to get a HitTestInfo object.
   System.Windows.Forms.DataGrid.HitTestInfo hi;   
   DataGrid grid 
= (DataGrid) sender;
   hi
=grid.HitTest(e.X, e.Y);
   
// Test if the clicked area was a cell.
   if(hi.Type==DataGrid.HitTestType.Cell ) {
      
// If it's a cell, get the GridTable and CurrencyManager of the
      
// clicked table.         
      DataGridTableStyle dgt = dataGrid1.TableStyles[0];     
      CurrencyManager myCurrencyManager 
= 
      (CurrencyManager)
this.BindingContext
      [myDataSet.Tables[dataGrid1.DataMember]];
      
// Get the Rectangle of the clicked cell.
      Rectangle cellRect;
      cellRect
=grid.GetCellBounds(hi.Row, hi.Column);
      
// Get the clicked DataGridTextBoxColumn.
      DataGridTextBoxColumn gridCol =
      (DataGridTextBoxColumn) dgt.GridColumnStyles[hi.Column];
      
// Insert code to edit the value.
      
   }

}