1 | '
|
---|
2 | ' Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
3 | '
|
---|
4 | ' This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
5 | ' available from http://www.virtualbox.org. This file is free software;
|
---|
6 | ' you can redistribute it and/or modify it under the terms of the GNU
|
---|
7 | ' General Public License (GPL) as published by the Free Software
|
---|
8 | ' Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
9 | ' VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
10 | ' hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
11 | '
|
---|
12 | ' Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
13 | ' Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
14 | ' additional information or have any questions.
|
---|
15 | '
|
---|
16 | Imports System
|
---|
17 | Imports System.Drawing
|
---|
18 | Imports System.Windows.Forms
|
---|
19 |
|
---|
20 | Module Module1
|
---|
21 |
|
---|
22 | Sub Main()
|
---|
23 | Dim vb As VirtualBox.IVirtualBox
|
---|
24 | Dim listBox As New ListBox()
|
---|
25 | Dim form As New Form
|
---|
26 |
|
---|
27 | vb = CreateObject("VirtualBox.VirtualBox")
|
---|
28 |
|
---|
29 | form.Text = "VirtualBox version " & vb.Version
|
---|
30 | form.Size = New System.Drawing.Size(400, 320)
|
---|
31 | form.Location = New System.Drawing.Point(10, 10)
|
---|
32 |
|
---|
33 | listBox.Size = New System.Drawing.Size(350, 200)
|
---|
34 | listBox.Location = New System.Drawing.Point(10, 10)
|
---|
35 |
|
---|
36 | For Each m In vb.Machines
|
---|
37 | listBox.Items.Add(m.Name & " [" & m.Id & "]")
|
---|
38 | Next
|
---|
39 |
|
---|
40 | form.Controls.Add(listBox)
|
---|
41 |
|
---|
42 | 'form.ShowDialog()
|
---|
43 | form.Show()
|
---|
44 | MsgBox("OK")
|
---|
45 | End Sub
|
---|
46 |
|
---|
47 | End Module
|
---|