VB.NET DataGridView利用ToolsTip动态展示提示信息

部署运行你感兴趣的模型镜像

利用 ToolsTip 动态展示提示信息

#Region "动态展示辅助提示信息 ToolTip"
    Private Sub DGV_RecordsetList_CellMouseClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DGV_RecordsetList.CellMouseClick
        If e.RowIndex < 0 OrElse e.ColumnIndex < 0 Then
            Exit Sub
        ElseIf e.Button = Windows.Forms.MouseButtons.Left Then
            显示提示信息(e.RowIndex)
        End If
    End Sub
    Private Sub 显示提示信息(ByVal RowIndex As Integer)
        With DGV_RecordsetList
        	'信息字符串拼接
            Dim ToolStr As String = "节目ID:" & .Rows(RowIndex).Cells(.Columns("节目ID").Index).Value & "    " & _
                "上载题名:" & .Rows(RowIndex).Cells(.Columns("上载题名").Index).Value & vbCrLf & _
                '....
                "接收题名:" & .Rows(RowIndex).Cells(.Columns("接收题名").Index).Value
            If .Rows(RowIndex).Cells(12).Value > 4 Then
                ToolStr &= vbCrLf & vbCrLf & _
                    "编目题名:" & .Rows(RowIndex).Cells(.Columns("编目题名").Index).Value & vbCrLf & vbCrLf & _
                    '... ...
                    "二审完成日期:" & .Rows(RowIndex).Cells(.Columns("二审完成日期").Index).Value
            End If
            Dim dp As New Point
            dp = PointToClient(MousePosition) '将屏幕鼠标坐标转为工作区域坐标
            dp.X += 10
            ToolTip1.Show(ToolStr, Me, dp)  ' New Point(PointToClient( MousePosition)))
        End With
    End Sub
    
    Private Sub DGV_RecordsetList_CellMouseLeave(sender As Object, e As DataGridViewCellEventArgs) Handles DGV_RecordsetList.CellMouseLeave
        ToolTip1.Hide(Me)
    End Sub
#End Region

您可能感兴趣的与本文相关的镜像

Llama Factory

Llama Factory

模型微调
LLama-Factory

LLaMA Factory 是一个简单易用且高效的大型语言模型(Large Language Model)训练与微调平台。通过 LLaMA Factory,可以在无需编写任何代码的前提下,在本地完成上百种预训练模型的微调

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值