SlideShare une entreprise Scribd logo
1  sur  12
Microsoft® Small Basic The Controls Object Estimated time to complete this lesson: 1 hour
The Controls Object In this lesson, you will learn about: Using various properties of the Controls object. Using control events on buttons and text boxes in your program. Using various operations of the Controls object.
Introduction to the Controls Object This lesson introduces you to the Controls object offered by Small Basic. Using the Controls object, you can insert simple controls like text boxes and buttons in the graphics window. So far, you have learned to use different objects in Small Basic, such as the GraphicsWindow, Shapes, File, and Math objects.
Operations of the Controls Object Before we move on and create a program by using the Controls object, let’s learn about some operations of the Controls object along with their parameters. AddTextBox—You can use this operation to add a text box to the graphics window. You must specify the x- and y-coordinates of the text box as parameters. AddButton—You can use this operation to add a button in the graphics window. You must specify the caption of the button and its x- and y-coordinates as parameters.
Operations of the Controls Object GetButtonCaption—With this operation, you can retrieve the caption of a button. You must specify the appropriate button name as a parameter.  SetButtonCaption—With this operation, you can set or change the caption of a button. You must specify the button name and the new caption as parameters. GetTextBoxText—You can retrieve the text present in a specified text box by specifying the text box name as a parameter for this operation. SetTextBoxText—You can define the text to appear in a text box. You must specify the name of the text box and the required text as parameters.
 Operations of the Controls Object Along with being able to add useful controls into your program, you can perform certain operations and define the settings for the controls you add. Let’s explore the Controls object with the help of an example.
Properties and Operations of the Controls object Let’s look at the capabilities offered by a few more operations and properties of the Controls object.  HideControl—You can use this operation to hide an existing control from the graphics window. ShowControl—This operation allows you to display a previously hidden control on the graphics window. Remove—You can use this operation to remove a control from the graphics window.
Properties and Operations of the Controls object SetSize—You can use this operation to specify a fixed size for a control. You must specify the control name and the height and width of the control as parameters. Move—You can use this operation to move a control to a new position in the graphics window. You must specify the control name as well as the height and width of the control as parameters.   LastClickedButton—You can use this operation to find the last button that was clicked on the graphics window. LastTypedTextBox—You can use this operation to find the last text box where text was typed.
The Controls Object Now let’s write a simple program by using the Controls object. This program can be used to display the definitions of a given word. output
Control  Events Now that you are familiar with the Controls object in Small Basic, let’s get acquainted with the events that you can use for the Controls object. Control events can generate actions in your program when a button is clicked or some text is typed into a text box. ButtonClicked raises an event when a button control is clicked. TextTyped raises an event when text is typed into a textbox control. And here’s an example of the TextTyped event: You can use the ButtonClicked event to make a simple calculator as shown to the right:
Let’s Summarize… Congratulations! Now you know how to: Usevarious properties of the Controls object. Use various operations of the Controls object. Use control events on buttons and text boxes in your program.
It’s Time to Apply Your Learning… Write a program to display a simple form, and perform the following steps: ,[object Object]

Contenu connexe

Similaire à 3.5 the controls object

Similaire à 3.5 the controls object (20)

Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
 
GUI -THESIS123
GUI -THESIS123GUI -THESIS123
GUI -THESIS123
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
Ppt lesson 03
Ppt lesson 03Ppt lesson 03
Ppt lesson 03
 
intro_gui
intro_guiintro_gui
intro_gui
 
Notification android
Notification androidNotification android
Notification android
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
 
Google calendar integration in iOS app
Google calendar integration in iOS appGoogle calendar integration in iOS app
Google calendar integration in iOS app
 
VB.Net-Controls and events
VB.Net-Controls and eventsVB.Net-Controls and events
VB.Net-Controls and events
 
Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual Basic
 
User Tutorial
User TutorialUser Tutorial
User Tutorial
 
4.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.154.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.15
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
 
Lab1-android
Lab1-androidLab1-android
Lab1-android
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.ppt
 
QTP Functions
QTP FunctionsQTP Functions
QTP Functions
 
Controls events
Controls eventsControls events
Controls events
 
CheckBox In C#.pptx
CheckBox In C#.pptxCheckBox In C#.pptx
CheckBox In C#.pptx
 
Vbtutorial
VbtutorialVbtutorial
Vbtutorial
 
Learning Robotic Process Automation-81-167
Learning Robotic Process Automation-81-167Learning Robotic Process Automation-81-167
Learning Robotic Process Automation-81-167
 

Plus de allenbailey

5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing codeallenbailey
 
4.4 advanced games
4.4   advanced games4.4   advanced games
4.4 advanced gamesallenbailey
 
4.3 collision detection
4.3   collision detection4.3   collision detection
4.3 collision detectionallenbailey
 
4.2 responding to events
4.2   responding to events4.2   responding to events
4.2 responding to eventsallenbailey
 
4.1 playing with shapes
4.1   playing with shapes4.1   playing with shapes
4.1 playing with shapesallenbailey
 
3.6 debugging aids
3.6   debugging aids3.6   debugging aids
3.6 debugging aidsallenbailey
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivityallenbailey
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arraysallenbailey
 
3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and outputallenbailey
 
2.4 sound, program, and text objects
2.4   sound, program, and text objects2.4   sound, program, and text objects
2.4 sound, program, and text objectsallenbailey
 
2.2 turtle graphics
2.2   turtle graphics2.2   turtle graphics
2.2 turtle graphicsallenbailey
 
1.5 branching and subroutines
1.5   branching and subroutines1.5   branching and subroutines
1.5 branching and subroutinesallenbailey
 
1.4 conditions and loops
1.4   conditions and loops1.4   conditions and loops
1.4 conditions and loopsallenbailey
 
1.2 statements, properties, and operations
1.2   statements, properties, and operations1.2   statements, properties, and operations
1.2 statements, properties, and operationsallenbailey
 
1.1 introduction to small basic
1.1   introduction to small basic1.1   introduction to small basic
1.1 introduction to small basicallenbailey
 

Plus de allenbailey (15)

5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing code
 
4.4 advanced games
4.4   advanced games4.4   advanced games
4.4 advanced games
 
4.3 collision detection
4.3   collision detection4.3   collision detection
4.3 collision detection
 
4.2 responding to events
4.2   responding to events4.2   responding to events
4.2 responding to events
 
4.1 playing with shapes
4.1   playing with shapes4.1   playing with shapes
4.1 playing with shapes
 
3.6 debugging aids
3.6   debugging aids3.6   debugging aids
3.6 debugging aids
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivity
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arrays
 
3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and output
 
2.4 sound, program, and text objects
2.4   sound, program, and text objects2.4   sound, program, and text objects
2.4 sound, program, and text objects
 
2.2 turtle graphics
2.2   turtle graphics2.2   turtle graphics
2.2 turtle graphics
 
1.5 branching and subroutines
1.5   branching and subroutines1.5   branching and subroutines
1.5 branching and subroutines
 
1.4 conditions and loops
1.4   conditions and loops1.4   conditions and loops
1.4 conditions and loops
 
1.2 statements, properties, and operations
1.2   statements, properties, and operations1.2   statements, properties, and operations
1.2 statements, properties, and operations
 
1.1 introduction to small basic
1.1   introduction to small basic1.1   introduction to small basic
1.1 introduction to small basic
 

Dernier

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Dernier (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

3.5 the controls object

  • 1. Microsoft® Small Basic The Controls Object Estimated time to complete this lesson: 1 hour
  • 2. The Controls Object In this lesson, you will learn about: Using various properties of the Controls object. Using control events on buttons and text boxes in your program. Using various operations of the Controls object.
  • 3. Introduction to the Controls Object This lesson introduces you to the Controls object offered by Small Basic. Using the Controls object, you can insert simple controls like text boxes and buttons in the graphics window. So far, you have learned to use different objects in Small Basic, such as the GraphicsWindow, Shapes, File, and Math objects.
  • 4. Operations of the Controls Object Before we move on and create a program by using the Controls object, let’s learn about some operations of the Controls object along with their parameters. AddTextBox—You can use this operation to add a text box to the graphics window. You must specify the x- and y-coordinates of the text box as parameters. AddButton—You can use this operation to add a button in the graphics window. You must specify the caption of the button and its x- and y-coordinates as parameters.
  • 5. Operations of the Controls Object GetButtonCaption—With this operation, you can retrieve the caption of a button. You must specify the appropriate button name as a parameter. SetButtonCaption—With this operation, you can set or change the caption of a button. You must specify the button name and the new caption as parameters. GetTextBoxText—You can retrieve the text present in a specified text box by specifying the text box name as a parameter for this operation. SetTextBoxText—You can define the text to appear in a text box. You must specify the name of the text box and the required text as parameters.
  • 6. Operations of the Controls Object Along with being able to add useful controls into your program, you can perform certain operations and define the settings for the controls you add. Let’s explore the Controls object with the help of an example.
  • 7. Properties and Operations of the Controls object Let’s look at the capabilities offered by a few more operations and properties of the Controls object. HideControl—You can use this operation to hide an existing control from the graphics window. ShowControl—This operation allows you to display a previously hidden control on the graphics window. Remove—You can use this operation to remove a control from the graphics window.
  • 8. Properties and Operations of the Controls object SetSize—You can use this operation to specify a fixed size for a control. You must specify the control name and the height and width of the control as parameters. Move—You can use this operation to move a control to a new position in the graphics window. You must specify the control name as well as the height and width of the control as parameters.   LastClickedButton—You can use this operation to find the last button that was clicked on the graphics window. LastTypedTextBox—You can use this operation to find the last text box where text was typed.
  • 9. The Controls Object Now let’s write a simple program by using the Controls object. This program can be used to display the definitions of a given word. output
  • 10. Control Events Now that you are familiar with the Controls object in Small Basic, let’s get acquainted with the events that you can use for the Controls object. Control events can generate actions in your program when a button is clicked or some text is typed into a text box. ButtonClicked raises an event when a button control is clicked. TextTyped raises an event when text is typed into a textbox control. And here’s an example of the TextTyped event: You can use the ButtonClicked event to make a simple calculator as shown to the right:
  • 11. Let’s Summarize… Congratulations! Now you know how to: Usevarious properties of the Controls object. Use various operations of the Controls object. Use control events on buttons and text boxes in your program.
  • 12.
  • 13. Add a Submit button to the form.
  • 14. When information is entered in all the text boxes and the Submit button is clicked, display an appropriate message.

Notes de l'éditeur

  1. Code:textbox = Controls.AddTextBox(200, 150)button = Controls.AddButton(“Button”, 150, 200)
  2. Notes:You can add controls onto the screen by typing a statement containing the Controls object with a suitable operation. Take a look at the example on the screen:First, you use the AddTextBoxoperation of the Controls object to add text boxes that accept the name of the user. You need to specify the x- and y-coordinates of the text boxes as parameters. Next, you use the AddButtonoperation to add a button onto the graphics window. Apart from the x- and y-coordinates, you must also specify the button caption as a parameter. Next, you use the AddMultiLineTextBox operation to add another text box. You must specify the x- and y-coordinates of the text box as the parameters.In this example, you want to display a message in the multiline text box when the Show Message button is clicked. So you use the ButtonClickedevent and create a subroutine for displaying a message in the multiline text box.Check the output of your program by clicking the Run button on the toolbar or pressing F5 on the keyboard.Code:GraphicsWindow.DrawText(50, 100, "Enter your first name:")firstname = Controls.AddTextBox(200, 100)GraphicsWindow.DrawText(50, 150, "Enter your last name:")lastname = Controls.AddTextBox(200, 150)showbutton = Controls.AddButton("Show Message", 150, 200)message = Controls.AddMultiLineTextBox(50, 250)Controls.SetSize(message, 310, 50) Controls.ButtonClicked = ShowMessage SubShowMessageIfControls.GetButtonCaption(showbutton) = "Show Message" ThenControls.SetTextBoxText(message,"Hello " + Controls.GetTextBoxText(firstname) + " " + Controls.GetTextBoxText(lastname))EndIfEndSub
  3. Code:Controls.SetSize(textbox, 300, 50)Controls.Move(textbox, 100, 150)Controls.LastClickedButtonControls.LastTypedTextBox
  4. Notes:You can create simple programs in Small Basic by using controls such as text boxes and buttons. For example, take a look at the program displayed. In this program, we write a code to display two text boxes and a Search button. In the first text box, the user enters a word. On clicking the Search button, the definition of the word is displayed in the second text box. We use the Dictionary object to display the meaning of the word in the multiline text box.Code:GraphicsWindow.Title = "Dictionary"GraphicsWindow.Height = 600GraphicsWindow.Width = 600GraphicsWindow.DrawText(50, 80, "Enter Text: ")textbox = Controls.AddTextBox(50, 100)Controls.SetSize(textbox, 100, 30)Controls.SetTextBoxText(textbox, "")GraphicsWindow.DrawText(50, 140, "Dictionary Meanings: ")multitxt = Controls.AddMultiLineTextBox(50, 160)Controls.SetSize(multitxt, 500, 400)Getdfn = Controls.AddButton("Search", 200, 100)GraphicsWindow.DrawText(80, 80, "")meaning = Dictionary.GetDefinition(Controls.GetTextBoxText(textbox))Controls.SetTextBoxText(multitxt, meaning)Controls.ButtonClicked = ShowmeaningSub ShowmeaningIf Controls.GetButtonCaption(Getdfn) = "Search" Then meaning = Dictionary.GetDefinition(Controls.GetTextBoxText(textbox)) Controls.SetTextBoxText(multitxt, meaning)EndIfEndSub
  5. Solution:GraphicsWindow.Show()GraphicsWindow.Width = 300GraphicsWindow.Height = 250GraphicsWindow.Top = (Desktop.Height - 450) / 2GraphicsWindow.left = (Desktop.Width - 600) / 2 GraphicsWindow.Title = "Application Form:"x = 30y = 37'Enter NameGraphicsWindow.DrawText(x, y, "Name:")NameTxtBox = Controls.AddTextBox(120, 35)Controls.SetSize(NameTxtBox, 150, 20) 'AddressGraphicsWindow.DrawText(x, y + 40, "Address:")AddressTxtBox = Controls.AddMultiLineTextBox(120, 70)Controls.SetSize(AddressTxtBox, 150, 40)  'Telephone detailsGraphicsWindow.DrawText(x, y + 90, "Telephone:")TelphoneTxtBox = Controls.AddTextBox(120, 125)Controls.SetSize(TelphoneTxtBox, 150, 20) 'Email -idGraphicsWindow.DrawText(x, y + 125, "E-mail ID:")EmailTxtBox = Controls.AddTextBox(120, 160)Controls.SetSize(EmailTxtBox, 150, 20) 'SubmitSubmitButton = Controls.AddButton("Submit", x + 30, y + 160)Controls.SetSize(SubmitButton, 70, 30) 'CancelCancelButton = Controls.AddButton("Cancel", x + 130, y + 160)Controls.SetSize(CancelButton, 70, 30) Controls.ButtonClicked = SubmitForm SubSubmitForm Name = controls.GetTextBoxText(NameTxtBox) Address = controls.GetTextBoxText(AddressTxtBox)Telphone = controls.GetTextBoxText(TelphoneTxtBox) Email = controls.GetTextBoxText(EmailTxtBox)IfControls.GetButtonCaption(Controls.LastClickedButton) = "Submit" ThenIf Name = "" or Address = "" or Telphone = "" or Email = "" ThenGraphicsWindow.ShowMessage("Please fill in all the details.", "Error Message")ElseGraphicsWindow.ShowMessage("Your details have been submitted successfully!", "Congratulations!")EndIfElseIfControls.GetButtonCaption(Controls.LastClickedButton) = "Cancel" ThenProgram.End() EndIfEndSub