我有以下步驟:轉私子到功能
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變成一個函數,但我不知道該如何實現。
究竟是你想實現什麼目標?處理程序總是Subs。 – Neolisk