ChrisO
Registered User.
- Local time
- Today, 14:38
- Joined
- Apr 30, 2003
- Messages
- 3,202
Another ‘undocumented feature’ just came to light.
Please see previous version.
To reproduce the ‘feature’ open one of the Forms.
Move the mouse over the bottom text box and the control tip text will be displayed.
Without going over any other text box go to the next record.
Without going over any other text box go back to the bottom text box.
The control tip text is still the same because it has not been updated.
Fix; we need another control to reinstate the Mouse Move event handler for the text box.
The Detail Mouse Move should do the job since the first thing we hit when leaving a control is generally the Detail section of the form.
Two procedures have been changed: -
New demo is attached.
Regards,
Chris.
Please see previous version.
To reproduce the ‘feature’ open one of the Forms.
Move the mouse over the bottom text box and the control tip text will be displayed.
Without going over any other text box go to the next record.
Without going over any other text box go back to the bottom text box.
The control tip text is still the same because it has not been updated.
Fix; we need another control to reinstate the Mouse Move event handler for the text box.
The Detail Mouse Move should do the job since the first thing we hit when leaving a control is generally the Detail section of the form.
Two procedures have been changed: -
Code:
Public Sub InitializeTextBoxes(ByRef frmThisForm As Form)
Dim ctl As Control
For Each ctl In frmThisForm
Select Case ctl.ControlType
Case acTextBox
[color=green]' Set both the OnMouseMove and OnDblClick handlers for all Text Boxes.[/color]
ctl.OnMouseMove = MakeFunctionCall("HandleMouseMove", frmThisForm.Name, ctl.Name)
ctl.OnDblClick = MakeFunctionCall("HandleMouseDoubleClick", frmThisForm.Name, ctl.Name)
Case Else
[color=green]' Do nothing[/color]
End Select
Next ctl
[color=green]' Set Mouse Move handler for the Detail section.[/color]
frmThisForm.Detail.OnMouseMove = MakeFunctionCall("HandleMouseMove", frmThisForm.Name, "Detail")
End Sub
Public Function HandleMouseMove(ByVal strFormName As String, _
ByVal strControlName As String)
Static strLastForm As String
Static strLastControl As String
[color=green]' Reinstate handler for last Control or Detail section.
' For some reason the syntax is not the same for the Detail section.[/color]
If strLastForm <> "" And strLastControl <> "" Then
If (IsLoaded(strLastForm)) Then
If strLastControl = "Detail" Then
Forms(strLastForm).Detail.OnMouseMove = MakeFunctionCall("HandleMouseMove", strLastForm, strLastControl)
Else
Forms(strLastForm)(strLastControl).OnMouseMove = MakeFunctionCall("HandleMouseMove", strLastForm, strLastControl)
End If
End If
End If
[color=green]' Save current Form and Control name.[/color]
strLastForm = strFormName
strLastControl = strControlName
If strControlName = "Detail" Then
[color=green]' Switch off Mouse Move handler for Detail section.[/color]
Forms(strLastForm).Detail.OnMouseMove = ""
Else
[color=green]' Switch off Mouse Move handler for this Control.[/color]
Forms(strFormName)(strControlName).OnMouseMove = ""
[color=green]' Set ControlTipText for this Control.[/color]
Forms(strFormName)(strControlName).ControlTipText = Nz(Forms(strFormName)(strControlName), "")
End If
End Function
Regards,
Chris.
Attachments
Last edited: