Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
C# / VB.NET - TASTO DOPPIA FUNZIONE
Forum - C# / VB.NET - TASTO DOPPIA FUNZIONE - Pagina 3

Pagine: [ 1 2 3 4 5 ] Precedente | Prossimo
Avatar
AMIGOS (Normal User)
Rookie


Messaggi: 49
Iscritto: 18/05/2009

Segnala al moderatore
Postato alle 20:16
Domenica, 31/05/2009
Grazie jeremy :k: ci avevo pensato mi ai preceduto anche se in modo molto più perfetto di come l avrei riscritto io.... grazie tante...

PM
Avatar
Jeremy (Normal User)
Pro


Messaggi: 134
Iscritto: 08/02/2009

Segnala al moderatore
Postato alle 20:28
Domenica, 31/05/2009
Testo quotato

Postato originariamente da AMIGOS:

No....
non intendo questo...

intendo ke cliccando su F1 e company....mi lanciano le istruzioni, come se fossero dei bottoni...


Vorrei lanciare queste istruzioni cliccando semplicemente su F1'
Codice sorgente - presumibilmente Plain Text

  1. 'istruzioni nel timer'
  2. SendKeys.Send((TextBox1.Text))
  3. SendKeys.Send(("{ENTER}"))


io le lancio con un bottone... ma vorrei lanciarle con F1... mi spiego :)

su F1 associo la textbox1
su f2 associo la texbox2 e cosi via...



Il discorso non cambia

Codice sorgente - presumibilmente VB.NET

  1. Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
  2.         Select Case e.KeyCode
  3.             Case Keys.F1
  4.                Timer3_Tick()
  5.             Case Keys.F2
  6.                Timer4_Tick()
  7.              etc.....
  8.         End Select
  9. End Sub



Facci sapere....
Ciao

PM
Avatar
AMIGOS (Normal User)
Rookie


Messaggi: 49
Iscritto: 18/05/2009

Segnala al moderatore
Postato alle 20:59
Domenica, 31/05/2009
Jeremy.. non ho provato ancora il codice..
ma per caso si puo adattare ad un solo timer...cosi mi pare... o sbaglio..
se cosi sarebbe grande la cosa....

cioè in vb6 tutte le funzioni rientrano in un solo timer... perke poi gli invi devono  partire con lo stesso tempo...
o basta associare tutti i Case allo stesso timer......

Ultima modifica effettuata da AMIGOS il 31/05/2009 alle 21:05
PM
Avatar
AMIGOS (Normal User)
Rookie


Messaggi: 49
Iscritto: 18/05/2009

Segnala al moderatore
Postato alle 21:26
Domenica, 31/05/2009
A scusa jeremy ! del codice sopra... mi interessa...o detto ciavrei pensato... ma come lo posti tu mi sempra piu ragionevole.... se puoi mettermelo a posto... ai una pizza pagata a roma...:)

Ultima modifica effettuata da AMIGOS il 31/05/2009 alle 21:33
PM
Avatar
Jeremy (Normal User)
Pro


Messaggi: 134
Iscritto: 08/02/2009

Segnala al moderatore
Postato alle 21:29
Domenica, 31/05/2009
Ciao.
Così dovrebbe essere completo

Codice sorgente - presumibilmente VB.NET

  1. Private Sub AperturaForm() Handles Me.Load
  2.         For Each Control As Control In Me.Controls
  3.             If TypeOf Control Is Button Then
  4.                 AddHandler Control.Click, AddressOf GestioneButtons
  5.             End If
  6.         Next
  7.     End Sub
  8.     Private Sub GestioneButtons(ByVal sender As Object, ByVal e As EventArgs)
  9.         Dim bt As Button = DirectCast(sender, Button)
  10.         If bt Is Button2 Then
  11.             Timer1.Enabled = False
  12.             Return
  13.         End If
  14.         If bt Is Button3 Then
  15.             For Each Control As Control In Me.Controls
  16.                 If TypeOf Control Is TextBox Then
  17.                     Control.Text = String.Empty
  18.                 End If
  19.             Next
  20.             Return
  21.         End If
  22.         If bt Is Button5 Then
  23.             Timer1.Interval = Int32.Parse(NumericUpDown1.Value.ToString)
  24.             Timer1.Enabled = True
  25.             Return
  26.         End If
  27.         If bt Is Button6 Then
  28.             NumericUpDown1.Value = 50D
  29.             Return
  30.         End If
  31.         If bt.Text = "Start" Then
  32.             bt.Text = "Stop"
  33.             Timer1.Interval = Int32.Parse(NumericUpDown1.Value.ToString)
  34.             Timer1.Enabled = True
  35.         Else
  36.             If bt.Text = "Stop" Then
  37.                 bt.Text = "Start"
  38.                 Timer1.Enabled = False
  39.             End If
  40.         End If
  41.     End Sub
  42.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  43.         ToolStripLabel2.Text = Len(TextBox1.Text).ToString
  44.         For Each Control As Control In Me.Controls
  45.             If TypeOf Control Is TextBox Then
  46.                 SendKeys.Send((Control.Text))
  47.                 SendKeys.Send(("{ENTER}"))
  48.             End If
  49.         Next
  50.     End Sub
  51.     Private Sub Form2_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
  52.         Select Case e.KeyCode
  53.             Case Keys.F1
  54.                 GestioneButtons(Button1, Nothing)
  55.             Case Keys.F2
  56.                 GestioneButtons(Button2, Nothing)
  57.             Case Keys.F3
  58.                 GestioneButtons(Button3, Nothing)
  59.             Case Keys.F4
  60.                 GestioneButtons(Button4, Nothing)
  61.             Case Keys.F5
  62.                 GestioneButtons(Button5, Nothing)
  63.             Case Keys.F6
  64.                 GestioneButtons(Button6, Nothing)
  65.             Case Keys.F7
  66.                 GestioneButtons(Button7, Nothing)
  67.             Case Keys.F8
  68.                 GestioneButtons(Button8, Nothing)
  69.             Case Keys.F9
  70.                 GestioneButtons(Button9, Nothing)
  71.             Case Keys.F10
  72.                 GestioneButtons(Button10, Nothing)
  73.         End Select
  74.     End Sub



Facci sapere....
Ciao

Ultima modifica effettuata da Jeremy il 31/05/2009 alle 21:30
PM
Avatar
AMIGOS (Normal User)
Rookie


Messaggi: 49
Iscritto: 18/05/2009

Segnala al moderatore
Postato alle 21:38
Domenica, 31/05/2009
Jeremy scusami una cosa se posso.......

ma tu nn sei normale.. per me sei un genio...

Sei davvero un freelance, anche se userei la parola "Titano"

Grazie! del tuo veloce e dettagliato aiuto Jeremy...

Sei un Grande...

PM
Avatar
Jeremy (Normal User)
Pro


Messaggi: 134
Iscritto: 08/02/2009

Segnala al moderatore
Postato alle 21:54
Domenica, 31/05/2009
Testo quotato

Postato originariamente da AMIGOS:

Jeremy scusami una cosa se posso.......

ma tu nn sei normale.. per me sei un genio...

Sei davvero un freelance, anche se userei la parola "Titano"

Grazie! del tuo veloce e dettagliato aiuto Jeremy...

Sei un Grande...



Aspetta che ti mando la fattura ... prima di fare i complimenti .... non lo sapevi??? Questo sito è a pagamento!!!
:rofl::rofl:
:pat:

PM
Avatar
AMIGOS (Normal User)
Rookie


Messaggi: 49
Iscritto: 18/05/2009

Segnala al moderatore
Postato alle 22:14
Domenica, 31/05/2009
:cheer::cheer::cheer::cheer:

domani ti kiedo di compilarmi un programmino....
poi manda la fattura al pizzettato digli ke passo io..... ahhahah

Ultima modifica effettuata da AMIGOS il 31/05/2009 alle 22:17
PM
Pagine: [ 1 2 3 4 5 ] Precedente | Prossimo