Richtextbox, comment prendre une ligne ?

Docki - 17 mai 2001 à 20:12
Galactus13 Messages postés 335 Date d'inscription lundi 29 septembre 2008 Statut Membre Dernière intervention 16 août 2023 - 23 nov. 2008 à 02:21
Voila, g un richtextbox (richtextbox1) dans lequel je lis un fichier, ce qui donne un truc comme ca :

ncfft=20247
cr=-6.186995e+000
fl=131072

Ma question est comment je pourrait mettre la premiére ligne dans label1.caption, et la troisiéme dans label2.caption. Merci de me repondre si vous savez comment faire. Docki

2 réponses

Salut

Es tu obliger d'utiliser un RichTextBox??? Ca serait plus simple de lire le truc comme ca :

open "fichier.txt" for input as #1

Line Input #1, a$
Label1 = a$

Line input #1, a$
Label2 = a$

Line Input #1, a$
Label3 = a$
close

Si non, ca doit donner un truc comme ca :

a$ = RichTextBox1.Text
Label1.Caption = Mid$(a$, 1, InStr(a$, vbCrLf) - 1)
a$ = Mid$(a$, InStr(a$, vbCrLf) + 2)
Label2.Caption = Mid$(a$, 1, InStr(a$, vbCrLf) - 1)
a$ = Mid$(a$, InStr(a$, vbCrLf) + 2)
Label3.Caption = a$

Question : int19h@usa.net

a+
0
Galactus13 Messages postés 335 Date d'inscription lundi 29 septembre 2008 Statut Membre Dernière intervention 16 août 2023 1
23 nov. 2008 à 02:21
Salut, merci sa m'a aidé aussi ! super !
0
Rejoignez-nous