Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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.
VB
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


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 is Picturebox in VB6)

So how is Coding in datagridview(C#) to handle 2 this line code in vb6?

Thanks!
Posted

1 solution

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.
 
Share this answer
 
Comments
ngthtra 26-Feb-11 23:53pm    
for you, event SpreadAccident_TextTipFetch is event dataGridView1_CellFormatting of datagridview?or any other event?
For display picture, your link only display a picture for all cells. this is not correst because we can display may picture on one column of datagridview.

do you have any other way?
thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900