init_dotnet();
using(System.Windows.Forms);

margin = spacing = 10;

top = new Form();
top.Width = 500;
top.Height = 300;
top.Text = 'XCircuit .NET Dialog Example';
top.FormBorderStyle = FormBorderStyle.FixedDialog;
top.MinimizeBox = top.MaximizeBox = false;
toprect = top.ClientRectangle;

okbtn = new Button();
okbtn.Text = 'OK';
okbtn.Top = toprect.Height-margin-okbtn.Height;
okbtn.Left = toprect.Width-margin-okbtn.Width;
top.Controls.Add(okbtn);
top.AcceptButton = okbtn;

cancelbtn = new Button();
cancelbtn.Text = 'Cancel';
cancelbtn.Top = okbtn.Top;
cancelbtn.Left = okbtn.Left-spacing-cancelbtn.Width;
top.Controls.Add(cancelbtn);
top.CancelButton = cancelbtn;

listwidth = (toprect.Width-2*margin)/2-spacing;
listheight = toprect.Height-2*margin-cancelbtn.Height-spacing;

list1 = new ListBox();
list1.Top = margin;
list1.Left = margin;
list1.Width = listwidth;
list1.Height = listheight;
list1.Items.Add('Library 1');
list1.Items.Add('Library 2');
top.Controls.Add(list1);

list2 = new ListBox();
list2.Top = margin;
list2.Left = toprect.Width-listwidth-margin;
list2.Width = listwidth;
list2.Height = listheight;
top.Controls.Add(list2);

top.ShowDialog();
