tx-oliveira Posted March 25, 2015 at 09:07 AM Report Share #580176 Posted March 25, 2015 at 09:07 AM (edited) *variável Boas, Tenho uma variavel que recebe varios valores, eu queria apresentar esses valores numa Textbox. Como posso tipo incrementar essa variavel? Utilizo um ciclo For ? Cumprimentos, Tiago Edited March 25, 2015 at 09:08 AM by tx-oliveira Link to comment Share on other sites More sharing options...
nelsonr Posted March 25, 2015 at 09:36 AM Report Share #580178 Posted March 25, 2015 at 09:36 AM Boas, a variavel é de que tipo? Para adicionares valor a uma variavel, normalmente basta somar o valor que pretendes, não precisas de ciclo Link to comment Share on other sites More sharing options...
tx-oliveira Posted March 25, 2015 at 09:56 AM Author Report Share #580179 Posted March 25, 2015 at 09:56 AM Viva, A variavel é integer. Mas eu nao queria somar, ja tenho os valores. So queria mesmo apresentar numa textbox, na listbox consigo apresenta todos na textbox so apresenta o ultimo valor Link to comment Share on other sites More sharing options...
nelsonr Posted March 25, 2015 at 10:20 AM Report Share #580182 Posted March 25, 2015 at 10:20 AM Então o melhor é mostrares o código que tens Link to comment Share on other sites More sharing options...
tx-oliveira Posted March 25, 2015 at 11:09 AM Author Report Share #580186 Posted March 25, 2015 at 11:09 AM responseData = System.Text.Encoding.Default.GetString(data, 0, bytes) Dim Ritorno As Byte() Dim Lunghezza As Integer ' Dim Quebra As String = Chr(0) & Chr(3) Ritorno = New [byte](256) {} Lunghezza = ConvByte(data, Ritorno) ' Funcao Dim Ii As Integer Dim dataOggi As Integer For Ii = 4 To Lunghezza + 3 dataOggi = Hex(Convert.ToInt16(Ritorno(Ii))) ListBox1.Items.Add(dataOggi) ' Certo TextBox1.Text += dataOggi.ToString() ' So aparece o ultimo Next Link to comment Share on other sites More sharing options...
nelsonr Posted March 25, 2015 at 11:34 AM Report Share #580187 Posted March 25, 2015 at 11:34 AM E confirmaste que passa ai várias vezes? Que valor tem a variavel Lunghezza? A função Hex não retorna uma string? Porque estás a guardar num integer? Link to comment Share on other sites More sharing options...
tx-oliveira Posted March 25, 2015 at 12:07 PM Author Report Share #580190 Posted March 25, 2015 at 12:07 PM Sim, passa porque na listbox aparece. Sim retorna numa string, guardei num integer porque pensei como sao numeros podessem ser inteiros Link to comment Share on other sites More sharing options...
nelsonr Posted March 25, 2015 at 12:25 PM Report Share #580191 Posted March 25, 2015 at 12:25 PM (edited) Faz la isto direto TextBox1.Text += Hex(Convert.ToInt16(Ritorno(Ii))) Podes mostrar que valores ficam na listbox e que valores ficam na textbox? Edited March 25, 2015 at 12:44 PM by apocsantos Link to comment Share on other sites More sharing options...
tx-oliveira Posted March 25, 2015 at 01:25 PM Author Report Share #580196 Posted March 25, 2015 at 01:25 PM (edited) Sim, funciona Obrigado Na listbox aparece a data de hoje Edited March 25, 2015 at 01:27 PM by tx-oliveira Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now