Search code examples
c#wpfmicrocontrolleruart

(C#) How to do this in WPF forms?(Looking on Orange5 design)


What im trying to do is design and fuctions(not all) like Orange5 has on a main area(see the link of the picture). This field origionally filled with "FFFF" letters, and the user can write into this cells, and change the data on into by clicking the "write" button. Also i can fill this field by pressing a "read" button, it will read the data from EEPROM . My code on Microcontroller is ready, and i already know how to send/receive/write/read data from/into EEPROM to C#. But i dont know how to relise this on C# with this design and functions. Any help please.. Click Here


Solution

  • You could create a new textbox (or a label that changes into a textbox when clicked if you want to do the extra work) for every 4 bits.

    Here's a very crude example:

    byte[] data = ... //get your data somehow...
    
    for(int i = 0; i < data.Length; i+=4) {
        TextBox tb = new TextBox();
        tb.Text = data[i] + data[i+1] + data[i+2] + data[i+3];
        grid.Children.Add(tb);
    }