7/23/2019 visual basic programming by victor mavhiki http://slidepdf.com/reader/full/visual-basic-programming-by-victor-mavhiki 1/15 Victor Mavhiki Question 1 An application to accept a character from the keyboard and display whether it is a vowel or not. output PublicClassfrm_vowelCheck 'Declarin Variables Dim c AsChar Private!ubbtn_check_Click"sender As#b$ect % e As&ventArs(andlesbtn_check.Click 'Assinin characters to the te)tbo) c * t)t_char.+e)t 'Displayin &rror Messae if numeric or characters are entered ,f,s-umeric"t)t_char.+e)t +hen Messaeo).!how"/Please &nter an Alphabetical 0etter/ % /+his is not an Alphabetical letter/'Clearin the te)tbo)es after the &rror messae displayed t)t_result.Clear" 1234 514 621 Pae 7
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
7/23/2019 visual basic programming by victor mavhiki
An application to accept a character from the keyboard and display whether it is avowel or not.
output
PublicClassfrm_vowelCheck
'Declarin VariablesDim c AsChar
Private!ubbtn_check_Click"sender As#b$ect% e As&ventArs(andlesbtn_check.Click
'Assinin characters to the te)tbo)
c * t)t_char.+e)t
'Displayin &rror Messae if numeric or characters are entered,f ,s-umeric"t)t_char.+e)t +henMessaeo).!how"/Please &nter an Alphabetical 0etter/% /+his is not anAlphabetical letter/
'Clearin the te)tbo)es after the &rror messae displayedt)t_result.Clear"
1234 514 621 Pae 7
7/23/2019 visual basic programming by victor mavhiki
An application to pick a date from a calendar control and display the day% month%year in separate te)tbo)es.
Output
PublicClassfrm_calender
Private!ub Date+imePicker7_ValueChaned"sender As#b$ect% e As&ventArs(andles Date+imePicker7.ValueChaned'assinin day's date to the te)bo) from date pickert)t_date.+e)t * Date+imePicker7.Value.Day
'assinin day of the week to the te)bo) from date picker
1234 514 621 Pae <
7/23/2019 visual basic programming by victor mavhiki
Private!ubbtn_recall_Click"sender As#b$ect% e As&ventArs(andlesbtn_recall.Click
'recallin what is in the memoryt)t_operaations.+e)t * m&nd!ub
Private!ubbtn_cancel_Click"sender As#b$ect% e As&ventArs(andlesbtn_cancel.Click
'cancellin the operations in the te)tbo)t)t_operaations.Clear"&nd!ub
Private!ubbtn_euals_Click"sender As#b$ect% e As&ventArs(andlesbtn_euals.Click
'selectin the operations / % :% % B/!electCase#ptnCase//t)t_operaations.+e)t * a Val"t)t_operaations.+e)tCase/:/t)t_operaations.+e)t * a : Val"t)t_operaations.+e)tCase//t)t_operaations.+e)t * a Val"t)t_operaations.+e)tCase/B/t)t_operaations.+e)t * a B Val"t)t_operaations.+e)t
&nd!elect&nd!ub
Private!ubbtn_e)it_Click"sender As#b$ect% e As&ventArs(andlesbtn_e)it.Click
'endin all the operations
1234 514 621 Pae 77
7/23/2019 visual basic programming by victor mavhiki
Private!ubPaste+ool!tripMenu,tem_Click"sender As#b$ect% e As&ventArs(andlesPaste+ool!tripMenu,tem.Click
'paste the te)t copied or cut form the richte)tbo)rt)_te)t&nter.Paste"
&nd!ub
Private!ub8ndo+ool!tripMenu,tem_Click"sender As#b$ect% e As&ventArs(andles8ndo+ool!tripMenu,tem.Click
'undo the operationrt)_te)t&nter.8ndo"&nd!ub
Private!ubFedo+ool!tripMenu,tem_Click"sender As#b$ect% e As&ventArs(andlesFedo+ool!tripMenu,tem.Click
'redo the operationrt)_te)t&nter.Fedo"&nd!ub
Private!ub&)it+ool!tripMenu,tem_Click"sender As#b$ect% e As&ventArs(andles&)it+ool!tripMenu,tem.ClickMessaeo).!how"/Are you sure you want to e)it/% /Continue/&nd&nd!ub
Private!ub Close+ool!tripMenu,tem_Click_7"sender As#b$ect% e As&ventArs(andlesClose+ool!tripMenu,tem.Click
Messaeo).!how"/Are you sure you want to close/% /Continue/
'Clossin the oprations&nd&nd!ub
Private!ub -ew+ool!tripMenu,tem7_Click"sender As#b$ect% e As&ventArs(andles -ew+ool!tripMenu,tem7.Click
1234 514 621 Pae 75
7/23/2019 visual basic programming by victor mavhiki