poltergeist
Programmer
An example how to capture the mouseclick an make different popups in each column.
Option Explicit
Dim rwSel As Integer
Private Sub DGrid_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim clSel As Integer
Dim intCnt As Integer
Dim refWid As Integer
If Button = 2 Then
clSel = -1
X = X - 390
For intCnt = DGrid.LeftCol To DGrid.Columns().Count - 1
If X < refWid Then Exit For
clSel = intCnt
refWid = refWid + DGrid.Columns(intCnt).Width
Next intCnt
rwSel = Int((Y - 195) / DGrid.RowHeight)
If rwSel <= (DGrid.ApproxCount - 1) Then
Select Case clSel
Case -1 To 12
PopupMenu pop3
Case 13
PopupMenu pop2
End Select
End If
End If
End Sub
the value -1 is to give back the click on the selector
If thier is anyone with a other great idea please let me know.
Peter
Option Explicit
Dim rwSel As Integer
Private Sub DGrid_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim clSel As Integer
Dim intCnt As Integer
Dim refWid As Integer
If Button = 2 Then
clSel = -1
X = X - 390
For intCnt = DGrid.LeftCol To DGrid.Columns().Count - 1
If X < refWid Then Exit For
clSel = intCnt
refWid = refWid + DGrid.Columns(intCnt).Width
Next intCnt
rwSel = Int((Y - 195) / DGrid.RowHeight)
If rwSel <= (DGrid.ApproxCount - 1) Then
Select Case clSel
Case -1 To 12
PopupMenu pop3
Case 13
PopupMenu pop2
End Select
End If
End If
End Sub
the value -1 is to give back the click on the selector
If thier is anyone with a other great idea please let me know.
Peter