ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦ó¦bTextBox¿é¤J¸ê®Æ«á«ö¤UEnter°õ¦æCommandButton(¤w§¹¦¨~¦A¦¸·PÁ¤j¤j­Ì)

[µo°Ý] ¦p¦ó¦bTextBox¿é¤J¸ê®Æ«á«ö¤UEnter°õ¦æCommandButton(¤w§¹¦¨~¦A¦¸·PÁ¤j¤j­Ì)

¥»©«³Ì«á¥Ñ av8d ©ó 2012-6-17 15:23 ½s¿è

¦bTextBox1¿é¤J¸ê®Æ«á«ö¤UEnter°õ¦æCommandButton4

§Ú¸Ó¦b­þ¸Ì¤U«ü¥O?
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
    If KeyCode = 13 Then CommandButton4.Click
End Sub

³o­Ó¦n¹³¤£¦æ~§V¤O¨D¸Ñ¤¤@@

Book1.rar (6.54 KB)

TOP

¦^´_ 1# av8d
  1. Option Explicit
  2. 'KeyDown¡BKeyUp ¨Æ¥ó'µo¥Í¦b·í¨Ï¥ÎªÌ«ö¦í¨Ã©ñ¶}«öÁä®É¡C
  3. 'KeyDown µo¥Í©ó¨Ï¥ÎªÌ«ö¤U«ö«öÁä¡C
  4. 'KeyUp µo¥Í¦b·í¨Ï¥ÎªÌ©ñ¶}«öÁä®É¡C
  5. Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
  6.     '---Shift As Integer : SHIFTÁä =1, CTRLÁä=2,ALT Áä=4 ----
  7.     If KeyCode = 13 Then Me.CommandButton1.SetFocus
  8. End Sub
  9. Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
  10.    MsgBox "©ñ¶}«öÁä  KeyCode = " & KeyCode & " ;  Shift = " & Shift
  11. End Sub
  12. 'KeyPress ¨Æ¥ó¥i¯àµo¥Í¦b«ö¤U¥H¤Uªº«öÁä®É:
  13. '¥ô¦ó¥i¦C¦LªºÁä½L¦r¤¸¡C
  14. 'CTRL »P­^¤å¦r¥ÀÁ䪺²Õ¦X¡C
  15. 'CTRL »P¯S®í¦r¤¸ªº²Õ¦X¡C
  16. 'BACKSPACE¡C
  17. 'ESC¡C
  18. 'KeyPress ¨Æ¥ó¤£·|µo¥Í¦b¥H¤U´X­Ó±¡ªp¤¤:
  19. '«ö TAB Áä¡C «ö ENTER Áä¡C «ö¤@­Ó¤è¦VÁä¡C
  20. Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
  21.     TextBox2 = Chr(KeyAscii)     '½Ð¦bªí³æ¤W ¥[¤JTextBox2
  22. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ av8d ©ó 2012-6-17 15:23 ½s¿è

¦^´_ 3# GBKEE


¸Ñ¶}¤F

If KeyCode = 13 Then CommandButton4_Click

§Y¥i¥H§¹¦¨~ÁÂÁ¤j¤j­Ì

TOP

¦^´_ 4# av8d
§Ú¨S¦³ 2007ª©°Ú

TOP

        ÀR«ä¦Û¦b : ¬°¤H³B¥@­n¤p¤ß²Ó¤ß¡A¦ý¤£­n¡u¤p¤ß²´¡v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD