05/06/09 1:33
AMIGOS
Vorrei dare focus a piu text....
cosi ho il focus solo sulla text1.... dovrei ampliarlo.
Private Sub Form_Load()
Dim NumFile As Integer
Dim sNomeFile As String
Dim txt As String
sNomeFile = "\PROVA.txt"
txt = Text1.Text
NumFile = FreeFile()
Open App.Path & "\PROVA.txt" For Input As #NumFile
Text1.Text = Input(LOF(NumFile), NumFile)
Close #NumFile
End Sub
Edit: modificato il titolo in quello più appropriato
Ultima modifica effettuata da GrG 06/06/09 11:45
aaa
05/06/09 6:36
the_angel
Non sono sicuro che si possa dare il focus a più di un oggetto per volta....
aaa
05/06/09 8:21
theprogrammer
Postato originariamente da AMIGOS:
Vorrei dare focus a piu text....
cosi ho il focus solo sulla text1.... dovrei ampliarlo.
Prima di mettersi a scrivere del codice e a fare domande e' BASILARE studiare qualche anno un po' di teoria, altrimenti si rischisa di fare domande senza senso ...
Ultima modifica effettuata da theprogrammer 05/06/09 8:22
aaa
06/06/09 1:52
AMIGOS
quello che salvo in prova text, vorrei caricarlo su più text.....
questo dicevo.....
ci riesco solo cosi.....
Private Sub Command1_Click()
Open App.Path & "\Prova.dat" For Output As #1 'salvo il contenuto delle 12 textbox'
Print #1, Text1.Text
Print #1, Text2.Text
Print #1, Text3.Text
Print #1, Text4.Text
Print #1, Text5.Text
Print #1, Text6.Text
Print #1, Text7.Text
Print #1, Text8.Text
Print #1, Text9.Text
Print #1, Text10.Text
Print #1, Text11.Text
Print #1, Text12.Text
Close #1
End Sub
Private Sub Form_Load()
Text1.Text = "" 'cancello il contenuto di default delle textbox'
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
On Error GoTo fine
Open App.Path & "\Prova.dat" For Input As 1 'carico il contenuto delle textbox'
Do
Input #1, linea
Text1.Text = Text1 & linea
Input #1, linea
Text2.Text = Text2 & linea
Input #1, linea
Text3.Text = Text3 & linea
Input #1, linea
Text4.Text = Text4 & linea
Input #1, linea
Text5.Text = Text5 & linea
Input #1, linea
Text6.Text = Text6 & linea
Input #1, linea
Text7.Text = Text7 & linea
Input #1, linea
Text8.Text = Text8 & linea
Input #1, linea
Text9.Text = Text9 & linea
Input #1, linea
Text10.Text = Text10 & linea
Input #1, linea
Text11.Text = Text11 & linea
Input #1, linea
Text12.Text = Text12 & linea
Loop Until EOF(1) = True
Close #1
Exit Sub
fine:
Close #1
MsgBox Err.Description
End Sub
Ultima modifica effettuata da AMIGOS 06/06/09 2:06
aaa
06/06/09 12:05
theprogrammer
Postato originariamente da AMIGOS:
quello che salvo in prova text, vorrei caricarlo su più text.....
questo dicevo.....
No. Tu parlavi di focus. Che e' un'altra cosa e non c'entra nulla con il tuo problema.
Tu devi utilizzare gli "array di textbox" (come gia' suggerito), ma il focus non c'entra nulla ...
aaa