S? d?ng m?i tn ln v xu?ng phm m?i tn ? di chuy?n tiu i?m

D?ch tiu ? D?ch tiu ?
ID c?a bi: 100413 - Xem s?n ph?m m bi ny p d?ng vo.
Bung t?t c? | Thu g?n t?t c?

? Trang ny

TM T?T

B?n c th? b?y cho cc m?i tn ln v xu?ng m?i tn m? r?ng bn phm phm trong m?t s? i?u khi?n Visual Basic b?ng cch ?t m? trong th? t?c s? ki?n KeyDown. Cc M? s? d?ng gi tr? m? phm ? b?y cc phm m?i tn ln v xu?ng m?i tn. B?n Tuy nhin, khng th?, b?y cc phm trong t?t c? cc i?u khi?n Visual Basic b?i v? m?t s? i?u khi?n ? ?c xy d?ng trong ch?c nng cho cc m?i tn ln v xu?ng Phm m?i tn, do , khng c s? ki?n KeyDown ?c t?o ra.

THNG TIN THM

Thng tin trong bi vi?t ny ?c cung c?p ? hi?n th? c th? b?y cc phm m?i tn ln v xu?ng m?i tn, tuy nhin, Microsoft khng khuyn b?n nn b?n th?c hi?n n b?i v? cc phm m?i tn ln v xu?ng m?i tn c tiu chu?n, ?c xc ?nh tr?c hnh vi trn m?t s? i?u khi?n. Microsoft khuy?n co r?ng b?n s? d?ng cc phng php tiu chu?n ? s? d?ng bn phm ? di chuy?n tiu i?m; m l, s? d?ng cc TAB v SHIFT + TAB phm ho?c s? d?ng cc phm truy c?p.

V d?-by-step cho di chuy?n m?i tn ln b?ng cch s? d?ng t?p trung v m?i tn xu?ng

  1. B?t ?u Visual Basic ho?c t? tr?nh n t?p, ch?n d? n m?i (ALT, F, N) n?u Visual Basic ang ch?y.
  2. Thm m?t h?p h?nh ?nh v hai h?p vn b?n ? Form1.
  3. Trong th? t?c s? ki?n Picture1_KeyDown, thm m? ny:
       Sub Picture1_KeyDown(KeyCode AS INTEGER, Shift AS INTEGER)
          IF KeyCode = 38 Then    '* 38 = up arrow key
             Text2.SetFocus
          Text2.SelStart = 0   '* set the cursor to the start
          END IF
    
          IF KeyCode = 40 Then    '* 40 = down arrow key
             Text1.SetFocus
          Text1.SelStart = 0   '* set the cursor to the start
          END IF
       END SUB
    						
  4. Trong th? t?c s? ki?n Text1_KeyDown, thm m? ny:
       Sub Text1_KeyDown(KeyCode AS INTEGER, Shift AS INTEGER)
          If KeyCode = 38 Then    '* 38 = UP ARROW key
             Picture1.SetFocus
          End If
    
          If KeyCode = 40 Then    '* 40 = DOWN ARROW key
             Text2.SetFocus
             Text2.SelStart = 0   '* set the cursor to the start
          End If
       End Sub
    						
  5. Trong th? t?c s? ki?n Text2_KeyDown, thm m? ny:
       Sub Text2_KeyDown(KeyCode AS INTEGER, Shift AS INTEGER)
          If KeyCode = 38 Then    '* 38 = UP ARROW key
             Text1.SetFocus
             Text1.SelStart = 0   '* set the cursor to the start
          End If
    
          If KeyCode = 40 Then    '* 40 = DOWN ARROW key
             Picture1.SetFocus
          End If
       End Sub
    						
  6. L?a ch?n Start Run menu ho?c nh?n F5 ? ch?y cc v d?. Phm m?i tn ln ho?c xu?ng m?i tn ? xem t?p trung di chuy?n ?n m?t ki?m sot khc nhau.
N?u b?n s? d?ng cc phm m?i tn tri ho?c m?i tn ph?i, b?n c th? di chuy?n trong m?t H?p vn b?n, nhng cc phm ?c b? qua trong h?p h?nh ?nh trong v d? ny.

Thu?c tnh

ID c?a bi: 100413 - L?n xem xt sau cng: 17 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
  • Microsoft Visual Basic 2.0 Standard Edition
  • Microsoft Visual Basic 3.0 Professional Edition
  • Microsoft Visual Basic 2.0 Professional Edition
  • Microsoft Visual Basic 1.0 Standard Edition
T? kha:
kbmt KB100413 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:100413
Khc t Ni dung trong C s Kin thc Khng con c h tr
Bi vi?t ny ni v? cc s?n ph?m m Microsoft khng c?n h? tr? n?a. Do , bi vi?t ny ?c cung c?p "nguyn b?n" v s? khng ?c c?p nh?t.

Cung cp Phan hi

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com