Basic Operators and Variable in Visual Basic
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
• 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
• Public Property CountryValue As String Private Sub Form2_Load(sender As Object, e As EventArgs) Handles
• Public Property LanguageValue As String MyBase.Load
• Public Property GenderValue As String
' Display the passed values in labels
lblName.Text = "Name: " & NameValue
• Public Property BioValue As String lblAge.Text = "Age: " & AgeValue
lblNationality.Text = "Nationality: " & NationalityValue
lblSkills.Text = "Skills: " & SkillsValue
lblHobbies.Text = "Hobbies: " & HobbiesValue
lblAddress.Text = "Address: " & AddressValue
lblCountry.Text = "Country: " & CountryValue
lblLanguage.Text = "Language: " & LanguageValue
lblGender.Text = "Gender: " & GenderValue
lblBio.Text = "Bio: " & BioValue
End Sub