Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. byte array To text box is it possible?

byte array To text box is it possible?

Scheduled Pinned Locked Moved C#
questiondata-structures
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gwithey
    wrote on last edited by
    #1

    An odd question but i have an interface which recieves a byte array of 1024 bytes from another device. Byte Number Page Column 0 to 127 0 0 to 127 // bottom right 128 to 255 1 0 to 127 256 to 383 2 0 to 127 384 to 511 3 0 to 127 512 to 639 4 0 to 127 640 to 767 5 0 to 127 768 to 895 6 0 to 127 896 to 1023 7 0 to 127 // top left Does anyone know if i can somehow convert these bytes to be represented in the text box on the GUI. 1023 896 895 768 767 640 // screen layout 639 512 511 384 383 256 255 128 127 0 Thanx in advance

    M 1 Reply Last reply
    0
    • G gwithey

      An odd question but i have an interface which recieves a byte array of 1024 bytes from another device. Byte Number Page Column 0 to 127 0 0 to 127 // bottom right 128 to 255 1 0 to 127 256 to 383 2 0 to 127 384 to 511 3 0 to 127 512 to 639 4 0 to 127 640 to 767 5 0 to 127 768 to 895 6 0 to 127 896 to 1023 7 0 to 127 // top left Does anyone know if i can somehow convert these bytes to be represented in the text box on the GUI. 1023 896 895 768 767 640 // screen layout 639 512 511 384 383 256 255 128 127 0 Thanx in advance

      M Offline
      M Offline
      musefan
      wrote on last edited by
      #2

      maybe something like...

      TextBox1.Clear();
      for(int i = 1023; i >= 0; i--)
      {
      TextBox1.Text += ByteArray[i] + " ";
      if(i % 128 == 0)
      TextBox1.Text += System.Environment.NewLine;
      }

      ...make sure you textbox supports multiline and that should work. Also you would be better using a StringBuilder[^].

      Life goes very fast. Tomorrow, today is already yesterday.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups