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 - enter key
Forum - C# / VB.NET - enter key

Avatar
Due (Normal User)
Pro


Messaggi: 68
Iscritto: 19/10/2007

Segnala al moderatore
Postato alle 19:16
Giovedė, 28/08/2008
Questo topic č stato chiuso dal moderatore

Nel mio programma ho una textbox chiamata "txt_Main".
Ora voglio che il programma scriva su questa textbox 2 stringhe, ma la seconda deve essere scritta a capo.
Il problema č che non so come imitare la pressione del tasto invio..ho provato cosė
Codice sorgente - presumibilmente Plain Text

  1. txt_Main.Text = stringa1 & keys.enter & stringa2


e non ha funzionato: mi scrive le due stringhe di seguito intermezzate da un "13".
Poi ho provato a scrivere:
Codice sorgente - presumibilmente Plain Text

  1. txt_Main.Text = stringa1
  2. SendKeys.Send("{enter}")
  3. txt_Main.Text = txt_Main.Text & stringa2


e mi scrive semplicemente le stringhe appiccicate...come posso fare?

PM
Avatar
manvb.net (Member)
Guru


Messaggi: 663
Iscritto: 28/01/2008

Segnala al moderatore
Postato alle 19:38
Giovedė, 28/08/2008
puoi usare la costante vbcrlf oppure puoi usare chr (10) & chr(13).

stringa1 & vbcrlf & stringa2
oppure
stringa1 & chr (10) & chr(13) & stringa2

Ultima modifica effettuata da manvb.net il 28/08/2008 alle 19:41
PM
Avatar
Due (Normal User)
Pro


Messaggi: 68
Iscritto: 19/10/2007

Segnala al moderatore
Postato alle 20:21
Giovedė, 28/08/2008
Funziona!! grazie :k:

PM