DataGridView鼠标经过Cell时弹出对话框
来源:互联网 发布:linux怎么打中文 编辑:程序博客网 时间:2024/05/03 09:31
Private Sub gdv_view_schedule_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gdv_view_schedule.MouseMove
Dim hitCell As DataGridView.HitTestInfo = Me.gdv_view_schedule.HitTest(e.X, e.Y)
Dim screenPoint As Point = Me.gdv_view_schedule.PointToScreen(New Point(e.X, e.Y))
Dim row_index As Integer = hitCell.RowIndex
Dim column_index As Integer = hitCell.ColumnIndex
If row_index = -1 OrElse column_index = -1 Then
Return
End If
Dim cell As DataGridViewCell = Me.gdv_view_schedule.Rows(row_index).Cells(column_index)
Dim frist_cell, last_cell, next_cell As DataGridViewCell
Dim start_time, end_time As DateTime
If Not cell.Value Is Convert.DBNull Then
If cell.Value = "Overlap" Then
frist_cell = Me.gdv_view_schedule.Rows(row_index).Cells(0)
last_cell = Me.gdv_view_schedule.Rows(row_index - 1).Cells(column_index)
next_cell = Me.gdv_view_schedule.Rows(row_index + 1).Cells(column_index)
For i As Integer = 0 To Me.end_time.Count - 1
If CType(Me.end_time(i), DateTime).Hour = CType(frist_cell.Value, DateTime).Hour Then
end_time = CType(Me.end_time(i), DateTime)
start_time = CType(Me.start_time(i), DateTime)
End If
Next
If Me.currentCell Is cell Then
Return
End If
If Not Me.currentCell Is cell Then
If (Not Me.hourScheduleViewForm Is Nothing) Then
Me.hourScheduleViewForm.Close()
End If
End If
Me.hourScheduleViewForm = New HourScheduleViewForm()
AddHandler hourScheduleViewForm.ViewFormClosed, AddressOf Me.ViewFormClosed
Me.hourScheduleViewForm.Init(Me.addOnModule, end_time, start_time, last_cell.ToolTipText, cell.ToolTipText, last_cell.Style.BackColor, next_cell.Style.BackColor)
Me.hourScheduleViewForm.Location = screenPoint
Me.hourScheduleViewForm.Show()
'Me.Focus()
Me.currentCell = cell
Else
If (Not Me.hourScheduleViewForm Is Nothing) Then
Me.hourScheduleViewForm.Close()
End If
Me.currentCell = cell
End If
End If
End Sub
备注:HourScheduleViewForm这个窗体使用SplashScreen(初始屏幕)效果会好些,类似于tooltip的效果;同时 Me.hourScheduleViewForm public 变量,主要是为确保每次仅只弹出一个窗体;其中有一部分是用于个人系统的判断代码,不需要时可以直接删除,防止代码冗余
- DataGridView鼠标经过Cell时弹出对话框
- DataGridView鼠标经过Cell时弹出对话框
- 鼠标经过弹出层
- bootstrap鼠标点击弹出菜单,鼠标经过弹出菜单
- AJAX实现鼠标经过弹出详细介绍
- 鼠标经过弹出透明遮罩层css写法
- 鼠标经过自动弹出提示框
- jquery鼠标经过弹出层写法
- DataGridView隔行变色鼠标经过改变形状及行变色
- datagridview 鼠标经过某一行,高亮显示
- Discuz!教程之如何隐藏上传附件图片鼠标经过时弹出“下载附件”等信息
- 鼠标经过时,表格变色
- .net鼠标经过时变色
- GridView鼠标经过时变色
- DataGrid鼠标经过感知以及点击行弹出窗口
- dataGrid双击弹出窗体并设置鼠标经过颜色
- GridView 实现 鼠标经过感知及点击行弹出窗口
- 鼠标经过连接弹出层效果(自适应显示方向)
- IL Stub Diagnostic Tool在CodePlex上发布了!
- firefox中禁止关闭最后一个标签页。
- C# 数据结构中 排序算法
- 计算机专业毕业后大致的工作方向
- Datatable操作【转】
- DataGridView鼠标经过Cell时弹出对话框
- 0A系统初步知识
- java 调用MS SQL SERVER2005 JDBC驱动的问题
- is的其它相关问题?
- SQL注入语句进阶学习
- Linux下参数处理函数--getopt函数族
- 演练
- gpg invalid解决方法
- Java的数据库连接编程(JDBC)技术