ContextMenuStrip和datagridview [英] ContextMenuStrip and datagridview

查看:84
本文介绍了ContextMenuStrip和datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过代码创建了一些datagridview及其ContextMenuStrip.
ContextMenuStrip中有很多选项.
我需要以下内容:
1-确定我在选择的ContextMenuStrip项上点击datagridview的.
2-或选择ContextMenuStrip项后返回行信息.

I created some datagridview and their ContextMenuStrip by code.
There are many options in ContextMenuStrip.
I need the following:
1- Identify the datagridview I clicked on when the ContextMenuStrip item is selected.
2- or return the row information after selecting ContextMenuStrip item.

推荐答案

要解决您的第一个问题 [
To help with your first problem Getting the control that called a context menu[^]

I am not sure that I understand your second part. ''return'' to where? perhaps you could expand that a little to make your question clearer.


向您询问答案
我主要在第二部分
从ContextMenuStrip中选择一个项目后,我需要确定哪一行或选择单击的行
tank you for your answer
and i main in the seconed part
after i select an item from the ContextMenuStrip i need to determaine which row or select the row that clicked on


感谢所有
我找到了解决办法
第1部分:
对ContextMenuStrip使用SourceControl属性,它返回ContextMenuStrip的最后一个控件

第2部分:
在datagridview上使用mousedown事件确定rowindex
thanx for all
i found the solution
part 1:
use SourceControl proprity for ContextMenuStrip which return the last control of the ContextMenuStrip

part2:
determin the rowindex using mousedown event on the datagridview


这篇关于ContextMenuStrip和datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆