Category Archives: GUI

Graphical User Interface

Embedded WebBrowser

Parsing and displaying HTML and Web content is an overwhelmingly complex issue. If you want to just display rich text inside your application (e.g. documentation) you usually need to rely on an external parser library. Luckily, Winforms provides an embedded … Continue reading

Posted in GUI, Web | 1 Comment

Interactive Session #9: Processing XML

Reading and interpreting XML data is performed through the System.Xml package. You need to create a new XmlDocument value and load the XML text into the XmlDocument. > open System.Xml;; > let txt = “<drawing><line><x>10.0</x><y>20.0</y><dx>50.0</dx> <dy>50.0</dy></line><circle><x>50.0</x><y>50.0</y><r>20.0</r> </circle></drawing>”;; val txt : … Continue reading

Posted in Getting Started, GUI, IO, Text | 1 Comment

Interactive Session #6: Winforms SplitContainer

The SplitContainer allows to add two forms separated by a bar to another form. First we need a form again. > open System.Windows.Forms;; > let f = new Form();; val f : Form = System.Windows.Forms.Form, Text: > f.Visible <- true;; … Continue reading

Posted in Getting Started, GUI | Leave a comment

Interactive Session #5: Creating and editing image files

Image manipulation is provided through the System.Drawing package. To create drawings you need to create a bitmap first. > open System.Drawing;; > let bitmap = new Bitmap(10, 10);; val bitmap : Bitmap You may edit the bitmap directly by setting … Continue reading

Posted in GUI, IO | Leave a comment

Winforms Menus

Creating menus in Winforms is easy: Create a new MainMenu and assign it to your form as a menu. Subsequently you can add submenus, assign keybord shortcuts and event handlers. open System open System.Windows.Forms let form = new Form() form.Text … Continue reading

Posted in GUI | Leave a comment

Interactive GUI programming

GUI libraries are usually very large and therefore it is as time consuming to learn a new language as it is to learn a new GUI library. The F# interactive can be very helpful in exploring the Winforms GUI toolkit … Continue reading

Posted in GUI | 2 Comments