如何在C#中的DataGridview中处理此代码 [英] How to handle this code at DataGridview in C#
问题描述
我有一些用VB6编写的行代码,现在我在C#中使用Datagridview,但是我不知道如何为datagridview编码,因为它可以处理事件与VB6中的相同代码.
这是VB6中控件Fpspread的事件TextTipFetch.
I have some line code that is written in VB6 and now I use Datagridview in C# but I do not know how to coding for datagridview that is it handle event the same code in VB6.
this is event TextTipFetch of control Fpspread in VB6.
Private Sub SpreadAccident_TextTipFetch(ByVal Col As Long, ByVal Row As Long, MultiLine As Integer, TipWidth As Long, TipText As String, ShowTip As Boolean)
If Col = 1 And Row = 0 Then
TipText = "This is ID column"
MultiLine = 1
TipWidth = 8000
ShowTip = True
End If
End Sub
对应于此事件,我应该使用datagridview的哪个事件以及如何编码?
另外在VB6中有如下代码:
Corresponding this event, which event should I use of datagridview and how to coding?
Addition on there are code in VB6 as below:
1. SpreadAccident.TypePictPicture=LoadPicture("")
2. SpreadAccident.TypePictPicture = PicA.Image;
(PicA是VB6中的Picturebox)
那么,如何在datagridview(C#)中进行编码以在vb6中处理2个此行代码?
(PicA is Picturebox in VB6)
So how is Coding in datagridview(C#) to handle 2 this line code in vb6?
Thanks!
推荐答案
就TextTipFetch事件而言,我假设它用于显示单元格的工具提示.如果是这样,您可以在此处引用 [此处 .microsoft.com/en-us/library/2ab8kd75.aspx"target =" _ blank"title =" New Window> ^ ]可能会给您一个想法,但不确定.
As far as TextTipFetch event is concerned, I assume that it is used to display tooltips for cells. If this is true, you may refer here[^] to see how it is done in C# (windows form app)
For displaying pictures in DataGridView, a sample here[^] might give you an idea, not sure though.
这篇关于如何在C#中的DataGridview中处理此代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!