Sunday, July 27, 2014

Simple Book Store Billing Project in VB.NET

Open Visual Studio 2012
New Project
Windows Form Application

Design :)

Coding :)


Public Class Form1

    Dim prc As Integer
    Dim q As Integer
    Dim d As Double = 0.15

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        'For Total net amount
        Dim tPrc As Integer
        prc = TextBox2.Text
        q = TextBox3.Text
        tPrc = prc * q
        TextBox4.Text = tPrc

        'For total amount of Discount
        Dim disc As Double
        disc = tPrc * d
        TextBox5.Text = disc

        'For discounted price
        Dim dPrc As Double
        dPrc = tPrc - disc
        TextBox6.Text = dPrc

        'For total no of Books
        TextBox7.Text = q

        'For total no of discount given
        TextBox8.Text = disc

        'For total Discounted amount
        TextBox9.Text = dPrc

        'For find average Discount
        Dim avgDisc As Double
        avgDisc = disc / q
        TextBox10.Text = avgDisc
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox6.Text = ""
        TextBox7.Text = ""
        TextBox8.Text = ""
        TextBox9.Text = ""
        TextBox10.Text = ""
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Application.Exit()
    End Sub
End Class

Output :)

Just chill Yaaro :P :)

RadioButtons and CheckBoxes effects on Label Text using VB.NET

Open Visual Studio 2012
New Project
Windows Form Application

Design :)

Coding :)

Public Class Form1

    Private Sub RadioButtonRed_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButtonRed.CheckedChanged
        Label3.ForeColor = Color.Red
    End Sub

    Private Sub RadioButtonGreen_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButtonGreen.CheckedChanged
        Label3.ForeColor = Color.Green
    End Sub

    Private Sub RadioButtonBlue_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButtonBlue.CheckedChanged
        Label3.ForeColor = Color.Blue
    End Sub

    Private Sub CheckBoxBold_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBoxBold.CheckedChanged
        Label3.Font = New Font(Label3.Font, FontStyle.Bold)
    End Sub

    Private Sub CheckBoxItalic_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBoxItalic.CheckedChanged
        Label3.Font = New Font(Label3.Font, FontStyle.Italic)
    End Sub

    Private Sub CheckBoxUnderline_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBoxUnderline.CheckedChanged
        Label3.Font = New Font(Label3.Font, FontStyle.Underline)
    End Sub

    Private Sub btnDisplay_Click(sender As Object, e As EventArgs) Handles btnDisplay.Click
        Label3.Text = TextBox1.Text & " " & TextBox2.Text
    End Sub

    Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click
        Label3.Text = ""
    End Sub
End Class

Output :)

Hope u Like This :) Thank you :)

Create a program to find interest in VB.NET

Open Visual Studio 2012
New Project
Windows Form Application

Design :)



Coding :)


Public Class Form1

    Dim p As Integer
    Dim r As Integer
    Dim n As Integer

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        p = TextBox1.Text
        r = TextBox3.Text
        n = TextBox2.Text

        Dim ans As Double

        ans = p * r * n / 100
        TextBox4.Text = ans
    End Sub
End Class

Output :)

Hope u like it friends :) Thanx :)

Saturday, July 26, 2014

2 values Calculator in vb.net

Open Visual Studio 2012
Create new project
Windows Form Application


Design :-


Coding :-

Public Class Form1

    Dim op As String
    Dim n1 As Integer
    Dim n2 As Integer

    Private Sub btn1_Click(sender As Object, e As EventArgs) Handles btn1.Click
        TextBox1.Text = TextBox1.Text & 1
    End Sub

    Private Sub btn2_Click(sender As Object, e As EventArgs) Handles btn2.Click
        TextBox1.Text = TextBox1.Text & 2
    End Sub

    Private Sub btn3_Click(sender As Object, e As EventArgs) Handles btn3.Click
        TextBox1.Text = TextBox1.Text & 3
    End Sub

    Private Sub btn4_Click(sender As Object, e As EventArgs) Handles btn4.Click
        TextBox1.Text = TextBox1.Text & 4
    End Sub

    Private Sub btn5_Click(sender As Object, e As EventArgs) Handles btn5.Click
        TextBox1.Text = TextBox1.Text & 5
    End Sub

    Private Sub btn6_Click(sender As Object, e As EventArgs) Handles btn6.Click
        TextBox1.Text = TextBox1.Text & 6
    End Sub

    Private Sub btn7_Click(sender As Object, e As EventArgs) Handles btn7.Click
        TextBox1.Text = TextBox1.Text & 7
    End Sub

    Private Sub btn8_Click(sender As Object, e As EventArgs) Handles btn8.Click
        TextBox1.Text = TextBox1.Text & 8
    End Sub

    Private Sub btn9_Click(sender As Object, e As EventArgs) Handles btn9.Click
        TextBox1.Text = TextBox1.Text & 9
    End Sub

    Private Sub btn0_Click(sender As Object, e As EventArgs) Handles btn0.Click
        TextBox1.Text = TextBox1.Text & 0
    End Sub

    Private Sub btnDot_Click(sender As Object, e As EventArgs) Handles btnDot.Click
        TextBox1.Text = TextBox1.Text & "."
    End Sub

    Private Sub btnPlus_Click(sender As Object, e As EventArgs) Handles btnPlus.Click
        n1 = TextBox1.Text
        TextBox1.Text = ""
        op = "+"
    End Sub

    Private Sub btnMinus_Click(sender As Object, e As EventArgs) Handles btnMinus.Click
        n1 = TextBox1.Text
        TextBox1.Text = ""
        op = "-"
    End Sub

    Private Sub btnMul_Click(sender As Object, e As EventArgs) Handles btnMul.Click
        n1 = TextBox1.Text
        TextBox1.Text = ""
        op = "*"
    End Sub

    Private Sub btnDiv_Click(sender As Object, e As EventArgs) Handles btnDiv.Click
        n1 = TextBox1.Text
        TextBox1.Text = ""
        op = "/"
    End Sub

    Private Sub btnEqual_Click(sender As Object, e As EventArgs) Handles btnEqual.Click
        n2 = TextBox1.Text

        If op = "+" Then
            TextBox1.Text = n1 + n2
        ElseIf op = "-" Then
            TextBox1.Text = n1 - n2
        ElseIf op = "*" Then
            TextBox1.Text = n1 * n2
        ElseIf op = "/" Then
            TextBox1.Text = n1 / n2
        End If
    End Sub

    Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click
        TextBox1.Text = " "
    End Sub

    Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
        Application.Exit()
    End Sub
End Class

Hope u like it friends :)

How to make digital watch using vb.net

Open Visual studio 2012
New project
Select Windows Form Application


In winForm,  Drag and drop Label from toolbox

In the properties of Label :-

Text - 00:00:00
Size - 40pt
BackColor - Black
ForeColor - White

Now drag and drop Timer.

Look at this pic for demo :-



Now double click on form , you will redirect to coding page :)

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Timer1.Start()
    End Sub

again back to design page and double click on Timer :)
In the coding page write below code :-

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Label1.Text = TimeString
    End Sub

Output :)