如果我的问题标题有点含糊,我深表歉意。我有下面调用表单的过程。超链接调用相同的表单,通过一个子。一切都很好,问题是如果我单击一个链接,然后单击另一个,表单会打开两次,这是应该发生的,因为我将表单实例化为 New。
我想要做的是只打开相同的表单,这样如果用户点击链接,那么只有一个表单打开而不是几个。
Private Sub dsbPositionBoard_FollowHyperlink(Target As Microsoft.Office.Interop.Excel.Hyperlink) Handles Me.FollowHyperlink
'This procedure runs when any of the hyperlinked cells in the position dashboard are clicked
'The hyperlinks open the frmDefinition on the assigned defintion. The procedure calls
'the function.
'The hyperlinked cells are assigned under the ThisWorkbook/Open event.
Dim definitionForm As New frmDefinitions
Select Case Target.TextToDisplay
Case "Exempt"
definitionForm.tmr_out.Enabled = True
sheetView.exemptDefinition()
Case "Employee Pay Distribution for Ranges", "Low Third", "Upper Third"
definitionForm.tmr_out.Enabled = True
sheetView.lowerThirdDefinition()
Case "Market Percentiles"
definitionForm.tmr_out.Enabled = True
sheetView.marketPercentileDefinition()
Case "Min", "Mid", "Max", "Salary Range to Mkt"
definitionForm.tmr_out.Enabled = True
sheetView.payGradeWidthDefintion()
Case "Total Cash Compensation Data"
definitionForm.tmr_out.Enabled = True
sheetView.totalCashCompDefition()
Case "Compa-Ratio"
definitionForm.tmr_out.Enabled = True
sheetView.compaRatioDefinition()
End Select
End Sub