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 2

Pagine: [ 1 2 3 4 5 ] Precedente | Prossimo
Avatar
()
Newbie


Messaggi:
Iscritto:

Segnala al moderatore
Postato alle 14:17
Sabato, 30/05/2009
Testo quotato

Postato originariamente da AMIGOS:
grazie cassin.simone


Di niente...prego!:asd:

PM
Avatar
AMIGOS (Normal User)
Rookie


Messaggi: 49
Iscritto: 18/05/2009

Segnala al moderatore
Postato alle 17:43
Domenica, 31/05/2009
Grazie ruggy94....delle if :k:
ma mi kiedo come mai, se clicco su 3 bottoni in contmporanea....2 me li lascia in stop..
come dovrebbe... e l 'altro me lo fa lampeggiare.....cosi se ne cliccassi anke piu..
solita cosa... posto il codice:

Codice sorgente - presumibilmente VB.NET

  1. Public Class Form1
  2.  
  3.  
  4.  
  5.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  6.  
  7.         If Button1.Text = "Start" Then
  8.             Button1.Text = "Stop"
  9.             Timer1.Interval = NumericUpDown1.Value
  10.             Timer1.Enabled = True
  11.         Else
  12.             If Button1.Text = "Stop" Then
  13.                 Button1.Text = "Start"
  14.                 Timer1.Enabled = False
  15.             End If
  16.  
  17.             End If
  18.     End Sub
  19.  
  20.  
  21.  
  22.  
  23.  
  24.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  25.         ToolStripLabel2.Text = Len(TextBox1.Text)
  26.         SendKeys.Send((TextBox1.Text))
  27.         SendKeys.Send(("{ENTER}"))
  28.     End Sub
  29.  
  30.     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  31.         TextBox1.Text = ""
  32.         TextBox2.Text = ""
  33.         TextBox3.Text = ""
  34.         TextBox4.Text = ""
  35.         TextBox5.Text = ""
  36.         TextBox6.Text = ""
  37.         TextBox7.Text = ""
  38.         TextBox8.Text = ""
  39.         TextBox9.Text = ""
  40.         TextBox10.Text = ""
  41.         TextBox11.Text = ""
  42.         TextBox12.Text = ""
  43.         TextBox13.Text = ""
  44.         TextBox14.Text = ""
  45.         TextBox15.Text = ""
  46.     End Sub
  47.  
  48.     Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  49.         If Button4.Text = "Start" Then
  50.             Button4.Text = "Stop"
  51.             Timer2.Interval = NumericUpDown1.Value
  52.             Timer2.Enabled = True
  53.         Else
  54.             If Button4.Text = "Stop" Then
  55.                 Button4.Text = "Start"
  56.                 Timer2.Enabled = False
  57.             End If
  58.  
  59.         End If
  60.     End Sub
  61.  
  62.     Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
  63.         SendKeys.Send((TextBox2.Text))
  64.         SendKeys.Send(("{ENTER}"))
  65.     End Sub
  66.  
  67.  
  68.     Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
  69.         If Button9.Text = "Start" Then
  70.             Button9.Text = "Stop"
  71.             Timer3.Interval = NumericUpDown1.Value
  72.             Timer3.Enabled = True
  73.         Else
  74.             If Button9.Text = "Stop" Then
  75.                 Button9.Text = "Start"
  76.                 Timer3.Enabled = False
  77.             End If
  78.  
  79.         End If
  80.     End Sub
  81.  
  82.     Private Sub Button29_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button29.Click
  83.         If Button29.Text = "Start" Then
  84.             Button29.Text = "Stop"
  85.             Timer11.Interval = NumericUpDown1.Value
  86.             Timer11.Enabled = True
  87.         Else
  88.             If Button29.Text = "Stop" Then
  89.                 Button29.Text = "Start"
  90.                 Timer11.Enabled = False
  91.             End If
  92.  
  93.         End If
  94.     End Sub
  95.  
  96.     Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
  97.         SendKeys.Send((TextBox3.Text))
  98.         SendKeys.Send(("{ENTER}"))
  99.     End Sub
  100.  
  101.     Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
  102.         SendKeys.Send((TextBox4.Text))
  103.         SendKeys.Send(("{ENTER}"))
  104.     End Sub
  105.  
  106.     Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer5.Tick
  107.         SendKeys.Send((TextBox5.Text))
  108.         SendKeys.Send(("{ENTER}"))
  109.     End Sub
  110.  
  111.     Private Sub Timer6_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer6.Tick
  112.         SendKeys.Send((TextBox6.Text))
  113.         SendKeys.Send(("{ENTER}"))
  114.     End Sub
  115.  
  116.     Private Sub Timer7_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer7.Tick
  117.         SendKeys.Send((TextBox7.Text))
  118.         SendKeys.Send(("{ENTER}"))
  119.     End Sub
  120.  
  121.     Private Sub Timer8_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer8.Tick
  122.         SendKeys.Send((TextBox8.Text))
  123.         SendKeys.Send(("{ENTER}"))
  124.     End Sub
  125.  
  126.     Private Sub Timer9_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer9.Tick
  127.         SendKeys.Send((TextBox9.Text))
  128.         SendKeys.Send(("{ENTER}"))
  129.     End Sub
  130.  
  131.     Private Sub Timer10_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer10.Tick
  132.         SendKeys.Send((TextBox10.Text))
  133.         SendKeys.Send(("{ENTER}"))
  134.     End Sub
  135.  
  136.     Private Sub Timer11_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer11.Tick
  137.         SendKeys.Send((TextBox11.Text))
  138.         SendKeys.Send(("{ENTER}"))
  139.     End Sub
  140.  
  141.     Private Sub Timer12_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer12.Tick
  142.         SendKeys.Send((TextBox12.Text))
  143.         SendKeys.Send(("{ENTER}"))
  144.     End Sub
  145.  
  146.     Private Sub Timer13_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer13.Tick
  147.         SendKeys.Send((TextBox13.Text))
  148.         SendKeys.Send(("{ENTER}"))
  149.     End Sub
  150.  
  151.     Private Sub Timer14_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer14.Tick
  152.         SendKeys.Send((TextBox14.Text))
  153.         SendKeys.Send(("{ENTER}"))
  154.     End Sub
  155.  
  156.     Private Sub Timer15_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer15.Tick
  157.         SendKeys.Send((TextBox15.Text))
  158.         SendKeys.Send(("{ENTER}"))
  159.     End Sub
  160.  
  161.     Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
  162.         If Button7.Text = "Start" Then
  163.             Button7.Text = "Stop"
  164.             Timer4.Interval = NumericUpDown1.Value
  165.             Timer4.Enabled = True
  166.         Else
  167.             If Button7.Text = "Stop" Then
  168.                 Button7.Text = "Start"
  169.                 Timer4.Enabled = False
  170.             End If
  171.  
  172.         End If
  173.     End Sub
  174.  
  175.     Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
  176.         If Button13.Text = "Start" Then
  177.             Button13.Text = "Stop"
  178.             Timer5.Interval = NumericUpDown1.Value
  179.             Timer5.Enabled = True
  180.         Else
  181.             If Button13.Text = "Stop" Then
  182.                 Button13.Text = "Start"
  183.                 Timer5.Enabled = False
  184.             End If
  185.  
  186.         End If
  187.     End Sub
  188.  
  189.     Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
  190.         If Button11.Text = "Start" Then
  191.             Button11.Text = "Stop"
  192.             Timer6.Interval = NumericUpDown1.Value
  193.             Timer6.Enabled = True
  194.         Else
  195.             If Button11.Text = "Stop" Then
  196.                 Button11.Text = "Start"
  197.                 Timer6.Enabled = False
  198.             End If
  199.  
  200.         End If
  201.     End Sub
  202.  
  203.     Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
  204.         If Button17.Text = "Start" Then
  205.             Button17.Text = "Stop"
  206.             Timer7.Interval = NumericUpDown1.Value
  207.             Timer7.Enabled = True
  208.         Else
  209.             If Button17.Text = "Stop" Then
  210.                 Button17.Text = "Start"
  211.                 Timer7.Enabled = False
  212.             End If
  213.  
  214.         End If
  215.     End Sub
  216.  
  217.     Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
  218.         If Button15.Text = "Start" Then
  219.             Button15.Text = "Stop"
  220.             Timer8.Interval = NumericUpDown1.Value
  221.             Timer8.Enabled = True
  222.         Else
  223.             If Button15.Text = "Stop" Then
  224.                 Button15.Text = "Start"
  225.                 Timer8.Enabled = False
  226.             End If
  227.  
  228.         End If
  229.     End Sub
  230.  
  231.     Private Sub Button33_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button33.Click
  232.         If Button33.Text = "Start" Then
  233.             Button33.Text = "Stop"
  234.             Timer9.Interval = NumericUpDown1.Value
  235.             Timer9.Enabled = True
  236.         Else
  237.             If Button33.Text = "Stop" Then
  238.                 Button33.Text = "Start"
  239.                 Timer9.Enabled = False
  240.             End If
  241.  
  242.         End If
  243.     End Sub
  244.  
  245.     Private Sub Button31_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button31.Click
  246.         If Button31.Text = "Start" Then
  247.             Button31.Text = "Stop"
  248.             Timer10.Interval = NumericUpDown1.Value
  249.             Timer10.Enabled = True
  250.         Else
  251.             If Button31.Text = "Stop" Then
  252.                 Button31.Text = "Start"
  253.                 Timer10.Enabled = False
  254.             End If
  255.  
  256.         End If
  257.     End Sub
  258.  
  259.     Private Sub Button27_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button27.Click
  260.         If Button27.Text = "Start" Then
  261.             Button27.Text = "Stop"
  262.             Timer12.Interval = NumericUpDown1.Value
  263.             Timer12.Enabled = True
  264.         Else
  265.             If Button27.Text = "Stop" Then
  266.                 Button27.Text = "Start"
  267.                 Timer12.Enabled = False
  268.             End If
  269.  
  270.         End If
  271.     End Sub
  272.  
  273.     Private Sub Button25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button25.Click
  274.         If Button25.Text = "Start" Then
  275.             Button25.Text = "Stop"
  276.             Timer13.Interval = NumericUpDown1.Value
  277.             Timer13.Enabled = True
  278.         Else
  279.             If Button25.Text = "Stop" Then
  280.                 Button25.Text = "Start"
  281.                 Timer13.Enabled = False
  282.             End If
  283.  
  284.         End If
  285.     End Sub
  286.  
  287.     Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button23.Click
  288.         If Button23.Text = "Start" Then
  289.             Button23.Text = "Stop"
  290.             Timer14.Interval = NumericUpDown1.Value
  291.             Timer14.Enabled = True
  292.         Else
  293.             If Button23.Text = "Stop" Then
  294.                 Button23.Text = "Start"
  295.                 Timer14.Enabled = False
  296.             End If
  297.  
  298.         End If
  299.     End Sub
  300.  
  301.     Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
  302.         If Button21.Text = "Start" Then
  303.             Button21.Text = "Stop"
  304.             Timer15.Interval = NumericUpDown1.Value
  305.             Timer15.Enabled = True
  306.         Else
  307.             If Button21.Text = "Stop" Then
  308.                 Button21.Text = "Start"
  309.                 Timer15.Enabled = False
  310.             End If
  311.  
  312.         End If
  313.     End Sub
  314.  
  315.     Private Sub Timer16_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
  316.         ToolStripLabel2.Text = Len(TextBox1.Text)
  317.     End Sub
  318.  
  319.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  320.         Timer16.Start()
  321.     End Sub
  322.  
  323.     Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
  324.  
  325.     End Sub
  326.  
  327.     Private Sub TextBox15_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
  328.  
  329.     End Sub
  330.  
  331.     Private Sub ToolStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolStrip1.ItemClicked
  332.  
  333.     End Sub
  334.  
  335.     Private Sub Timer16_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer16.Tick
  336.         ToolStripLabel2.Text = Len(TextBox1.Text)
  337.         ToolStripLabel3.Text = Len(TextBox2.Text)
  338.         ToolStripLabel4.Text = Len(TextBox3.Text)
  339.         ToolStripLabel5.Text = Len(TextBox4.Text)
  340.         ToolStripLabel6.Text = Len(TextBox5.Text)
  341.         ToolStripLabel7.Text = Len(TextBox6.Text)
  342.         ToolStripLabel8.Text = Len(TextBox7.Text)
  343.         ToolStripLabel9.Text = Len(TextBox8.Text)
  344.         ToolStripLabel10.Text = Len(TextBox9.Text)
  345.         ToolStripLabel11.Text = Len(TextBox10.Text)
  346.         ToolStripLabel12.Text = Len(TextBox11.Text)
  347.         ToolStripLabel13.Text = Len(TextBox12.Text)
  348.         ToolStripLabel14.Text = Len(TextBox13.Text)
  349.         ToolStripLabel15.Text = Len(TextBox14.Text)
  350.         ToolStripLabel16.Text = Len(TextBox15.Text)
  351.  
  352.  
  353.     End Sub
  354.  
  355.  
  356.  
  357.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  358.  
  359.    
  360.         Timer1.Enabled = False
  361.      
  362.         Timer2.Enabled = False
  363.        
  364.         Timer3.Enabled = False
  365.        
  366.         Timer4.Enabled = False
  367.        
  368.         Timer5.Enabled = False
  369.        
  370.         Timer6.Enabled = False
  371.        
  372.         Timer7.Enabled = False
  373.        
  374.         Timer8.Enabled = False
  375.        
  376.         Timer9.Enabled = False
  377.        
  378.         Timer10.Enabled = False
  379.        
  380.         Timer11.Enabled = False
  381.        
  382.         Timer12.Enabled = False
  383.        
  384.         Timer13.Enabled = False
  385.        
  386.         Timer14.Enabled = False
  387.        
  388.         Timer15.Enabled = False
  389.  
  390.     End Sub
  391.  
  392.     Private Sub Button5_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
  393.        
  394.         Timer1.Interval = NumericUpDown1.Value
  395.         Timer1.Enabled = True
  396.         Timer2.Interval = NumericUpDown1.Value
  397.         Timer2.Enabled = True
  398.         Timer3.Interval = NumericUpDown1.Value
  399.         Timer3.Enabled = True
  400.         Timer4.Interval = NumericUpDown1.Value
  401.         Timer4.Enabled = True
  402.         Timer5.Interval = NumericUpDown1.Value
  403.         Timer5.Enabled = True
  404.         Timer6.Interval = NumericUpDown1.Value
  405.         Timer6.Enabled = True
  406.         Timer7.Interval = NumericUpDown1.Value
  407.         Timer7.Enabled = True
  408.         Timer8.Interval = NumericUpDown1.Value
  409.         Timer8.Enabled = True
  410.         Timer9.Interval = NumericUpDown1.Value
  411.         Timer9.Enabled = True
  412.         Timer10.Interval = NumericUpDown1.Value
  413.         Timer10.Enabled = True
  414.         Timer11.Interval = NumericUpDown1.Value
  415.         Timer11.Enabled = True
  416.         Timer12.Interval = NumericUpDown1.Value
  417.         Timer12.Enabled = True
  418.         Timer13.Interval = NumericUpDown1.Value
  419.         Timer13.Enabled = True
  420.         Timer14.Interval = NumericUpDown1.Value
  421.         Timer14.Enabled = True
  422.         Timer15.Interval = NumericUpDown1.Value
  423.         Timer15.Enabled = True
  424.     End Sub
  425.  
  426.     Private Sub Button6_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
  427.         NumericUpDown1.Value = "50"
  428.     End Sub
  429.  
  430.     Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripLabel2.Click
  431.  
  432.  
  433.     End Sub
  434. End Class



I bottoni sono numerati a caso, perkè prima avevo sia bottoni per lo start sia per lo stop....e gli o cancellati per adattare la vostra funzione...

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


Messaggi: 49
Iscritto: 18/05/2009

Segnala al moderatore
Postato alle 18:03
Domenica, 31/05/2009
Volevo chiedervi un altro favore se posso.....

Io volevo adattare l'invio delle frasi ..con tasti  F1 ad F12.... cosi da farne
12 con tasti di scelta rapida F1 F2 F3 fino ad F12, e 12 con tasto start e stop....
se nn possibile, allora sapere solo se era possibile adattare al posto dei buttoni i tasti F..

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


Messaggi: 134
Iscritto: 08/02/2009

Segnala al moderatore
Postato alle 18:29
Domenica, 31/05/2009
Testo quotato

Postato originariamente da AMIGOS:

Volevo chiedervi un altro favore se posso.....

Io volevo adattare l'invio delle frasi ..con tasti  F1 ad F12.... cosi da farne
12 con tasti di scelta rapida F1 F2 F3 fino ad F12, e 12 con tasto start e stop....
se nn possibile, allora sapere solo se era possibile adattare al posto dei buttoni i tasti F..


Ma ti sei fumato qualcosa????:om:
Non era meglio se andavi al mare???:cheer:

Prendi fiato e spiegati un pò meglio!!!:rofl:

Senza offese ma se non si capisce bene il problema non ti si può aiutare.

Facci sapere...
Ciao

PM
Avatar
AMIGOS (Normal User)
Rookie


Messaggi: 49
Iscritto: 18/05/2009

Segnala al moderatore
Postato alle 19:16
Domenica, 31/05/2009
Vorrei attivare i comandi che invio con i bottoni, con i tasti F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12

insomma invece che inviare coi bottoni vorrei inviare con i tasti sopra citati....

invece di cliccare su button1 per inviare
clicco su F1
e cosi per il resto F2 ecc.

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


Messaggi: 134
Iscritto: 08/02/2009

Segnala al moderatore
Postato alle 19:39
Domenica, 31/05/2009
Testo quotato

Postato originariamente da AMIGOS:

Vorrei attivare i comandi che invio con i bottoni, con i tasti F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12

insomma invece che inviare coi bottoni vorrei inviare con i tasti sopra citati....

invece di cliccare su button1 per inviare
clicco su F1
e cosi per il resto F2 ecc.



Ok ... adesso è chiaro.
Puoi gestire l'evento KeyUp del Form e fare un selectcase per capire quale tasto è stato premuto e puntare alla routine gestita attualmente dal button.

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.                 Button1_Click()
  5.             Case Keys.F2
  6.                 Button2_Click()
  7.              etc.....
  8.         End Select
  9. End Sub



Ti conviene però, cancellare la firma del metodo ButtonX_Click()...voglio dire:
invece di:
Codice sorgente - presumibilmente VB.NET

  1. Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click


diventa:
Codice sorgente - presumibilmente C# / VB.NET

  1. Private Sub Button21_Click() Handles Button21.Click




Facci sapere...
Ciao

Ultima modifica effettuata da Jeremy il 31/05/2009 alle 19:43
PM
Avatar
Jeremy (Normal User)
Pro


Messaggi: 134
Iscritto: 08/02/2009

Segnala al moderatore
Postato alle 20:01
Domenica, 31/05/2009
Ciao
Volendo perderci un pò di tempo sopra, si potrebbe sistemare un pò quel codice che hai scritto.

Intento prova a ragionare su questo, se ti interessa mettiamo a posto il resto.

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 ButtonClick
  5.                 Control.Tag = New Timer With {.Interval = Int32.Parse(NumericUpDown1.Value.ToString), .Tag = Control.Name}
  6.                 AddHandler DirectCast(Control.Tag, Timer).Tick, AddressOf GestioneTimer
  7.             End If
  8.         Next
  9.     End Sub
  10.     Private Sub ButtonClick(ByVal sender As Object, ByVal e As System.EventArgs)
  11.         Dim bt As Button = DirectCast(sender, Button)
  12.         Dim Tmr As Timer = DirectCast(bt.Tag, Timer)
  13.  
  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.Text = "Start" Then
  23.             bt.Text = "Stop"
  24.             Tmr.Enabled = True
  25.         ElseIf bt.Text = "Stop" Then
  26.             bt.Text = "Start"
  27.             Tmr.Enabled = False
  28.         End If
  29.     End Sub
  30.     Private Sub GestioneTimer(ByVal sender As System.Object, ByVal e As System.EventArgs)
  31.         Dim Tmr As Timer = DirectCast(sender, Timer)
  32.         Select Case Tmr.Tag.ToString
  33.             Case "Button1"
  34.                 SendKeys.Send((TextBox1.Text))
  35.                 SendKeys.Send(("{ENTER}"))
  36.             Case "Button2"
  37.                 etc....
  38.             Case "Button3"
  39.                 etc....
  40.             Case "Button4"
  41.         End Select
  42.     End Sub



Facci sapere...
Ciao

PM
Avatar
AMIGOS (Normal User)
Rookie


Messaggi: 49
Iscritto: 18/05/2009

Segnala al moderatore
Postato alle 20:11
Domenica, 31/05/2009
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...

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