我有以下程序:
Private Sub btnRptEmployeePayToMarket_MouseDown(ByValsender As Object, ByVal myButton As System.Windows.Forms.MouseEventArgs) Handles btnRptEmployeePayToMarket.MouseDown
Static Toggle As Boolean
If myButton.Button = MouseButtons.Right Then
If Toggle Then
descForm.Hide()
Else
descForm.lblReportTitle.Text = "Ranges to Market"
descForm.txtButtonDescription.Text = "Learn how you are currently paying specific departments or jobs compared to market. "
descForm.Show()
End If
End If
Toggle = Not Toggle
End Sub
由于我有大约 9 个按钮可以执行相同的操作,但只更改 descForm.lblReportTitle 和 descForm.txtButtonDescription 中的文本,我该如何完成呢?
我想把 sub 变成一个函数,但我不知道如何实现。