31/05/09 18:11
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'
'istruzioni nel timer'
SendKeys.Send((TextBox1.Text))
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...
Ultima modifica effettuata da AMIGOS 31/05/09 18:12
aaa
31/05/09 18:59
AMIGOS
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 31/05/09 19:05
aaa
31/05/09 19:26
AMIGOS
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 31/05/09 19:33
aaa
31/05/09 19:29
Jeremy
Ciao.
Così dovrebbe essere completo
Private Sub AperturaForm() Handles Me.Load
For Each Control As Control In Me.Controls
If TypeOf Control Is Button Then
AddHandler Control.Click, AddressOf GestioneButtons
End If
Next
End Sub
Private Sub GestioneButtons(ByVal sender As Object, ByVal e As EventArgs)
Dim bt As Button = DirectCast(sender, Button)
If bt Is Button2 Then
Timer1.Enabled = False
Return
End If
If bt Is Button3 Then
For Each Control As Control In Me.Controls
If TypeOf Control Is TextBox Then
Control.Text = String.Empty
End If
Next
Return
End If
If bt Is Button5 Then
Timer1.Interval = Int32.Parse(NumericUpDown1.Value.ToString)
Timer1.Enabled = True
Return
End If
If bt Is Button6 Then
NumericUpDown1.Value = 50D
Return
End If
If bt.Text = "Start" Then
bt.Text = "Stop"
Timer1.Interval = Int32.Parse(NumericUpDown1.Value.ToString)
Timer1.Enabled = True
Else
If bt.Text = "Stop" Then
bt.Text = "Start"
Timer1.Enabled = False
End If
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ToolStripLabel2.Text = Len(TextBox1.Text).ToString
For Each Control As Control In Me.Controls
If TypeOf Control Is TextBox Then
SendKeys.Send((Control.Text))
SendKeys.Send(("{ENTER}"))
End If
Next
End Sub
Private Sub Form2_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
Select Case e.KeyCode
Case Keys.F1
GestioneButtons(Button1, Nothing)
Case Keys.F2
GestioneButtons(Button2, Nothing)
Case Keys.F3
GestioneButtons(Button3, Nothing)
Case Keys.F4
GestioneButtons(Button4, Nothing)
Case Keys.F5
GestioneButtons(Button5, Nothing)
Case Keys.F6
GestioneButtons(Button6, Nothing)
Case Keys.F7
GestioneButtons(Button7, Nothing)
Case Keys.F8
GestioneButtons(Button8, Nothing)
Case Keys.F9
GestioneButtons(Button9, Nothing)
Case Keys.F10
GestioneButtons(Button10, Nothing)
End Select
End Sub
Facci sapere....
Ciao
Ultima modifica effettuata da Jeremy 31/05/09 19:30
aaa
31/05/09 19:38
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...
aaa