The GUI we used in the previous section is not sufficient for our trading application, but it illustrated the basics of how to put a GUI together using F#. Next, we'll add the controls needed and prepare it to present the information from the model. The following is a mock representation showing where the controls will be placed and the overall idea about the GUI:
Let's look at the required code. Most of the code is straightforward, following the same rules used in the GUI in the last section. The DataGridView
control has some properties set for the width to be adjusted automatically. The same is true for labels, where the property AutoSize
is set to true. The final GUI will look like the one in the screenshot displayed after the following code:
/// GUI code according to mock namespace GUI open System open System.Drawing open System.Windows.Forms open Agents open Model open System.Net open System.ComponentModel // User interface...