如何在datagridview中单击鼠标单击时标记文本 [英] how to make text marked when cell mouseclick in datagridview
本文介绍了如何在datagridview中单击鼠标单击时标记文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在数据鼠标中单击鼠标,如下图所示,如何标记文本:
https ://www.dropbox.com/s/tcfk1i1lsqhwgk1/Untitled.png
当我点击单元格时,我有一个选定的单元格,但我想要选择其中的文字
抱歉我的英文不好:)
how to make text marked when cell mouseclick in datagridview like this pic:
https://www.dropbox.com/s/tcfk1i1lsqhwgk1/Untitled.png
when i click on the cell i have a selected cell but i want to select the text in it
sorry for my bad english :)
推荐答案
如果单元格的类型是System.Windows.Forms.DataGridViewTextBoxCell
或您自己的某种类型。请参阅:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewtextboxcell(v=vs.110).aspx [ ^ ]。
参见:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell%28v=vs.110%29.aspx [< a href =http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell%28v=vs.110%29.aspxtarget =_ blanktitle =New Window> ^ ],
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn%28v=vs.1 10%29.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewtextboxcolumn(v = vs.110)的.aspx 一> [ ^ ]。
在这里,你会发现一个选择一些文字的方法: http://social.msdn.microsoft.com/Forums/windows/en-US/1170edc5-91c6-4cb6-8ada-525ce6dccbec/datagridviewtextboxcell-how-to - 选择高亮规格编辑期间的特色字符?forum = winforms [ ^ ]。
-SA
This is possible if the type of the cell isSystem.Windows.Forms.DataGridViewTextBoxCell
or some appropriate type of your own. Please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewtextboxcell(v=vs.110).aspx[^].
See also:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewtextboxcolumn(v=vs.110).aspx[^].
Here, you will find a recipe for selection of some text: http://social.msdn.microsoft.com/Forums/windows/en-US/1170edc5-91c6-4cb6-8ada-525ce6dccbec/datagridviewtextboxcell-how-to-select-highlight-specific-characters-during-edit?forum=winforms[^].
—SA
这篇关于如何在datagridview中单击鼠标单击时标记文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文