come posso spostare il focus di una text premendo il tasto "freccia su" ??
E ALL'INGIU'?
come posso spostare il focus di una text premendo il tasto "freccia su" ??
E ALL'INGIU'?
se lo sapessi ti aiuterei io invece sto chiedendo come si carica una lista di file .txt facendola comparire in un txtbox se lo sai mi aiuti?
ciaoo![]()
Se hai 3 textbox, nominale tutte Text1, e imposta la prop Index, creando una matrice di controlli.
codice:Text1_Keydown(Index as integer,KeyCode As Integer, Shift As Integer) if keycode=vbkeydown then if index > numerotextbox -1 then text1(0).setfocus else text1(index + 1).setfocus end if elseif keycode=vbkeyup then if index =0 then text1(numerotextbox-1).setfocus else text1(index - 1).setfocus end if end if![]()
Usa l'evento KeyDown e il metodo SetFocus. Esempio:
Ciaocodice:Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyDown Then Text3.SetFocus 'sposta il focus al textbox successivo ElseIf KeyCode = vbKeyUp Then Text1.SetFocus 'sposta il focus al textbox precedente End If End Sub
Chi non cerca trova.
grazie tante![]()