0% found this document useful (0 votes)
50 views11 pages

Basic Operators and Variable in Visual Basic

The document outlines the creation of a calculator form in Visual Basic, detailing the use of variables, operators, and helper methods for functionality. It includes instructions for button actions, input retrieval, and data passing to another form. Additionally, it specifies how to display inputted details in the second form using public properties.

Uploaded by

Joshua Camarillo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views11 pages

Basic Operators and Variable in Visual Basic

The document outlines the creation of a calculator form in Visual Basic, detailing the use of variables, operators, and helper methods for functionality. It includes instructions for button actions, input retrieval, and data passing to another form. Additionally, it specifies how to display inputted details in the second form using public properties.

Uploaded by

Joshua Camarillo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Basic Operators and Variable in Visual Basic

Method helpers
Goal
• Create a calculator form
• Code and declare variables, operators used
and method helper
• Run code
• ButtonClicked – triggers button to perform its tasks
• GetInput - Helper method to retrieve and convert input from textboxes to
integer
• .Clear()- method helpers that clear the txtbox.

Challenge
• Each button must function according to is functionality
• Use GetInput method to retrieve integer from textbox
• Tryparse Integer helper to convert string representation of a number to its
32-bit signed integer equivalent.
Sample Code

‘Add more for the other buttons’

‘This is the end class’


Passing Value using Get

• fullName – Textbox
• Gender – RadioButton
• Hobbies- Checkbox ()
• Nationality – ComboBox()
• Skills-CheckList()
• Bio(RichText)
• ProfilePicture(PictureBox)
• Address(ListBox)
• Age- NumericUpDown
• Favorate BrowserWeb
• Birthday: Date Picker
How to pass the value?
Provide the necessary details
in the form
Declare variables as you submit the button

Dim f2 As New Form2()//method to instantiate form2

' Set public properties to pass values


[Link] = Name
[Link] = Age
[Link] = Nationality
[Link] = Skills
[Link] = Hobbies
[Link] = Address
[Link] = Country
[Link] = Language
[Link] = Gender
[Link] = Bio
Dispay Form in Form2 the inputted details
• Public Property NameValue As String
• Public Property AgeValue As String
• Public Property NationalityValue As String
• Public Property SkillsValue As String
• Public Property HobbiesValue As String
• Public Property AddressValue As String

• Public Property CountryValue As String Private Sub Form2_Load(sender As Object, e As EventArgs) Handles
• Public Property LanguageValue As String [Link]
• Public Property GenderValue As String
' Display the passed values in labels
[Link] = "Name: " & NameValue
• Public Property BioValue As String [Link] = "Age: " & AgeValue
[Link] = "Nationality: " & NationalityValue
[Link] = "Skills: " & SkillsValue
[Link] = "Hobbies: " & HobbiesValue
[Link] = "Address: " & AddressValue
[Link] = "Country: " & CountryValue
[Link] = "Language: " & LanguageValue
[Link] = "Gender: " & GenderValue
[Link] = "Bio: " & BioValue

End Sub

You might also like