To use EasyLanguage form controls and containers,
you must have the following elements:
- Declare a variable for each container or control to be
used. The class type of each variable must be appropriate
for the object it will reference. Remember to include the
identifier "elsystem.windows.forms" in front of
the specific class type unless you have previously added a
'using' statement
for the forms namespace. In this example, "form1"
and "button1" are the names of the variables being
created.
vars:
elsystem.windows.forms.Form form1(Null ), //declare
form1 as a Form type variable
elsystem.windows.forms.Button
button1(Null); //declare button1 as a Button type variable
- Create an instance of each container and control object
by assigning it to the object variable created above.
form1
= form.create("Form Heading", 100, 100); //create
a form container object and assign it to form1
button1 = button.create("MY BUTTON", 40, 30 ); //create
a button control object and assign it to button1
- Add control objects (eg. buttons) to a container object
(eg. form1).
form1.AddControl(button1);
- Set the location property to specify the relative placement
of a control within a container.
button1.Location(
50, 50 );
- Add an event handler (a method to call when a control event
occurs, such as when a button is clicked).
button1.Click += OnButton1Click;
- Finally, write the method(s) to be called when an event
happens.
method
void OnButton1Click( elsystem.Object sender, elsystem.EventArgs
args )
begin
//Your EasyLanguage
code
end;