byte array To text box is it possible?
-
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
-
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
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.