從控制台進入到語言設定
> Control Panel\Clock, Language, and Region\Language

從左側選擇進階選項
找到更換語言快速鍵

把切換輸入法改為Ctrl+Shift

OK囉!!
'只能輸入數字
If e.KeyChar = Chr(48) Or e.KeyChar = Chr(49) Or e.KeyChar = Chr(50) Or e.KeyChar = Chr(51) Or e.KeyChar = Chr(52) Or e.KeyChar = Chr(53) Or e.KeyChar = Chr(54) Or e.KeyChar = Chr(55) Or e.KeyChar = Chr(56) Or e.KeyChar = Chr(57) Or e.KeyChar = Chr(13) Or e.KeyChar = Chr(8) Then
e.Handled = False
Else
e.Handled = True
End If
'Get the first day of the month
'取得當月的第一天
Public Function FirstDayOfMonth(ByVal sourceDate As DateTime) As DateTime
Return New DateTime(sourceDate.Year, sourceDate.Month, 1)
End Function
'Get the last day of the month
'取得當月的最後一天
Public Function LastDayOfMonth(ByVal sourceDate As DateTime) As DateTime
Dim lastDay As DateTime = New DateTime(sourceDate.Year, sourceDate.Month, 1)
Return lastDay.AddMonths(1).AddDays(-1)
End Function
'根據日期取得上個月的最後一天
Public Shared Function LastDayOfLastMonth(ByVal sourceDate As DateTime) As DateTime
Dim lastDay As DateTime = New DateTime(sourceDate.Year, sourceDate.Month, 1)
Return lastDay.AddMonths(0).AddDays(-1)
End Function
'根據日期取得下個月的第一天
Public Shared Function FirstDayOfNextMonth(ByVal sourceDate As DateTime) As DateTime
Dim NextDay As DateTime = New DateTime(sourceDate.Year, sourceDate.Month, 1)
Return NextDay.AddMonths(1).AddDays(0)
End Function
Private Sub txtbox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtbox1.KeyPress
'只能輸入字母
If Char.IsLetter(e.KeyChar) = True Or Char.IsControl(e.KeyChar) = True Then
e.Handled = False
Else
e.Handled = True
End If
End Sub
