MATLAB COM Builder    

Creating the User Interface

Now add a series of controls to the blank form to complete the dialog, as summarized in the next table.

Control Type
Control Name
Properties
Purpose
Frame
Frame1
Caption = Magic Squares Demo
Groups controls
Label
Label1
Caption = Magic Square Size
Labels the magic square edit box.
TextBox
edtSize

Accepts input of magic square size.
CommandButton
btnCreate
Caption = Create
When pressed, creates a new magic square with current size.
ListView
lstMagic
GridLines = True
LabelEdit = lvwManual
View = lvwReport
Displays the magic square.

Figure 4-3, Controls Layout on the Form, shows the shows the controls layout on the form.

Figure 4-3: Controls Layout on the Form

When the form and controls are complete, add the code below to the form. This code references the control and variable names listed above. If you have given different names for any of the controls or any variable, change this code to reflect those differences.


  Creating the Visual Basic Project Creating the Executable