Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
App. WinForms / WPF .NET
DtaGrid Evento KeyDown
venerdì 28 settembre 2007 - 15.19
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
IlCondor72
Profilo
| Newbie
35
messaggi | Data Invio:
ven 28 set 2007 - 15:19
Ciao a Tutti
Ho bisogno di aiuto.
Qualcuno può dirmi perchè quando sono all'interno della datagrid non scatta
l'evento keydown ne quello della datagrid ne quello sul form su cui ho
settato keypreview = true?
Ho scritto le seguenti funzioni :
Private Sub Clienti_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
MsgBox("Clienti_KeyDown")
' Gestione Tastiera
If e.KeyValue = Keys.F1 Or Keys.F2 Or Keys.F3 Or Keys.F4 Or Keys.F5 Or Keys.F6 Or Keys.F7 Or Keys.F8 Or Keys.F9 Or Keys.F10 Or Keys.F11 Or Keys.F12 Then
FuncKeysModule(e.KeyValue)
e.Handled = True
End If
End Sub
Private Sub DataGrid1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DataGrid1.KeyDown
MsgBox("DataGrid1_KeyDown")
' Gestione Tastiera
If e.KeyValue = Keys.F1 Or Keys.F2 Or Keys.F3 Or Keys.F4 Or Keys.F5 Or Keys.F6 Or Keys.F7 Or Keys.F8 Or Keys.F9 Or Keys.F10 Or Keys.F11 Or Keys.F12 Then
FuncKeysModule(e.KeyValue)
e.Handled = True
End If
End Sub
Public Sub FuncKeysModule(ByVal value As Keys)
Select Case value
Case Keys.F1 ' Indietro
Me.Close()
Case Keys.F2
Case Keys.F3 ' Ricerca
Try
'''''''''''''''''''''''''''''''''''''''''
' Aggiornamento DataGrid dal DataSet dal DataAdapter
'''''''''''''''''''''''''''''''''''''''''
DataView1.RowFilter = "CodiceCliente Like '" + Replace(CodiceCliente.Text, " ", "") + "' And RagioneSociale Like '" + Replace(RagioneSociale.Text, " ", "") + "' And Localita Like '" + Replace(Localita.Text, " ", "") + "' And CodiceFiscaleOPartitaIVA Like '" + Replace(CodiceFiscaleOPartitaIVA.Text, " ", "") + "'"
'''''''''''''''''''''''''''''''''''''''''
Catch Ex As Exception
End Try
Case Keys.F4
MsgBox("Keys.F4")
' Determina il Codice Cliente dal DataGrid
Dim Cursore As Integer = CInt(DataGrid1.CurrentRowIndex.ToString)
VariabiliGlobali.CodiceCliente = DataGrid1.Item(Cursore, 0)
' Chiude la Maschera
Me.ActiveForm.Close()
Case Keys.F5
Case Keys.F6
Case Keys.F7
Case Keys.F8
Case Keys.F9
Case Keys.F10
Case Keys.F11
Case Keys.F12
End Select
End Sub
Nonostante le 3 funzioni non riesco a catturare l'evento Tastieradal dataGrid.
Grazie per l' aiuto
Il Mio Sito :
http://xoomer.alice.it/francescovattimo/
Il Mio Blog :
http://francescovattimo.blogspot.com/
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !