0% found this document useful (0 votes)
156 views4 pages

Public Class Form1

The document describes code for a simple calculator application with the following functionality: - Buttons to input numbers 0-9 and perform basic math operations - Variables to store the first input number, math operator, and result - Event handlers for each button click to add input to the textbox or perform calculations - A select case statement to evaluate the operator and calculate the result It also provides an example of managing multiple forms, with buttons to open another form and hide the original form.

Uploaded by

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

Public Class Form1

The document describes code for a simple calculator application with the following functionality: - Buttons to input numbers 0-9 and perform basic math operations - Variables to store the first input number, math operator, and result - Event handlers for each button click to add input to the textbox or perform calculations - A select case statement to evaluate the operator and calculate the result It also provides an example of managing multiple forms, with buttons to open another form and hide the original form.

Uploaded by

JSEL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1.

Simple application calculator


Coding
Public class form1
Dim op as char
Dim a, m as integer
Private sub textbox1_textchanged()
End sub
From1_load()
End Sub
Button1_click()
Textbox1.appendtext(1)
End sub
Button2_click()
Textbox1.appendtext(2)
End sub
Button3_click()
Textbox1.appendtext(3)
End sub
Button4_click()
Textbox1.appendtext(4)
End sub
Button5_click()
Textbox1.appendtext(5)
End sub
Button5_click()
Textbox1.appendtext(5)
End sub
Button6_click()
Textbox1.appendtext(6)
End sub

Button7_click()
Textbox1.appendtext(7)
End sub
Button8_click()
Textbox1.appendtext(8)
End sub
Button9_click()
Textbox1.appendtext(9)
End sub
Button10_click()
Textbox1.appendtext(0)
End sub
Button13_click()
Textbox1.text=
End sub
Button14_click()
a=val(textbox1.text)
op=+
textbox1.clear()
End sub
Button15_click()
a=val(textbox1.text)
op=-
textbox1.clear()
End sub
Button16_click()
a=val(textbox1.text)
op=*
textbox1.clear()
End sub

Button11_click()
M=textbox1.text
Textbox1.clear()
End sub
Button12_click()xtbox1.text)
Op=/
Textbox1.clear()
A=val(
End sub
Button17_click()
Select case op
Case+
Textbox1.text=a+val(textbox1.text)
Case-
Textbox1.txt=a-val(textbox1.text)
Case*
Textbox1.text=a*val(textbox1.text)
Case/
Textbox1.text=a/val(textbox1.text)
End select
End sub
End class
2.manage multiple forms
Coding
Form1:
Public class form1
Button1_click()
Form2.show()
End sub
End class

Form2:
Public class form2
Button1_click()
Msgbox(do u want to hide the form1,msgboxstyle.yesno)
Form1.hide()
End sub
End class

.net learning for beginners


http://www.homeandlearn.co.uk/csharp/csharp.html

You might also like