Lost Event Example


Form 1

Public Class Form1

    Private Sub BtnTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnTotal.Click
        ComboBox3.Hide()
        ComboBox2.Hide()
        ComboBox1.Hide()
        TextBox1.Show()
        TextBox1.Text = (ComboBox1.Text & " ." & ComboBox2.Text & " ." & ComboBox3.Text)
      
        Dim na, mdy, sal, hrent As Integer
        sal = Val(Txtsalary.Text)
        hrent = Val(Txthouserent.Text)
        txttotal.Text = sal + hrent
        na = Val(Txtname.Text)
        mdy = Val(TextBox1.Text)
        'TextBox1.Hide()
        'TextBox2.Hide()
        Dim M As Integer, R As String
        M = TextBox3.Text
        If M >= 90 And M <= 99 Then
            R = "A+"
            ListBox1.Items.Add(R)
            'TextBox1.Hide()
            'TextBox2.Hide()
        ElseIf M >= 75 And M <= 89 Then

            R = "A"
            ListBox1.Items.Add(R)
        ElseIf M >= 65 And M <= 74 Then
            'TextBox1.Hide()
            'TextBox2.Hide()
            R = "A-"
            ListBox1.Items.Add(R)
        ElseIf M >= 50 And M <= 64 Then

            R = "B+"
            ListBox2.Items.Add(R)
        ElseIf M >= 40 And M <= 49 Then
            ' TextBox1.Hide()
            ' TextBox2.Hide()
            R = "B"
            ListBox2.Items.Add(R)
        ElseIf M >= 30 And M <= 39 Then

            R = "B-"
            ListBox2.Items.Add(R)
        End If
        MsgBox(TextBox1.Text & " , " & TextBox2.Text & "" & "Total TK " & txttotal.Text)
      
    End Sub

    Private Sub Txtname_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txtname.TextChanged
        Txtname.Text = TextBox2.Text
    End Sub

    Private Sub Txtjoining_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub Txtsalary_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txtsalary.TextChanged

    End Sub

    Private Sub Txthouserent_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txthouserent.TextChanged



    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Hide()
        TextBox2.Hide()
        Dim day As Integer
        For day = 1 To 31
            ComboBox2.Items.Add(day)
        Next
        'TextBox1.Hide()
        'TextBox2.Hide()
        Dim month As Integer
        For month = 1 To 12
            ComboBox1.Items.Add(MonthName(month))
        Next

        Dim year As Integer
        For year = 1990 To 2020
            ComboBox3.Items.Add(year)
        Next

        'TextBox2.Text = "Muhammad Rifat Hasan"
        ComboBox1.Text = Now.Day
        ComboBox2.Text = Now.Month
        ComboBox3.Text = Now.Year
        Txtsalary.Text = "4500"
        Txthouserent.Text = "1500"
        ' Dim na, mdy, sal, hrent As Integer
        'sal = Val(Txtsalary.Text)
        'hrent = Val(Txthouserent.Text)
        'txttotal.Text = sal + hrent
        'na = Val(Txtname.Text)
        'mdy = Val(TextBox1.Text)


    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Hide()
        ComboBox1.Show()
        ComboBox2.Show()
        ComboBox3.Show()
        ComboBox1.Text = Now.Day
        ComboBox2.Text = Now.Month
        ComboBox3.Text = Now.Year
        Txtsalary.Clear()
        Txthouserent.Clear()
        txttotal.Clear()
        TextBox2.Clear()
        TextBox3.Clear()

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()

    End Sub

  
    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        Txtname.Hide()
        TextBox2.Show()
        TextBox2.Text = "Muhammad Rifat Hasan"
    End Sub


    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        BtnTotal.Text = TimeOfDay
    End Sub


    Private Sub Label10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label10.Click
        Timer1.Start()
    End Sub

    Private Sub Label11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label11.Click
        Timer1.Stop()
        BtnTotal.Text = "Total"


    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        ListBox1.Items.Clear()
        ListBox2.Items.Clear()

    End Sub
End Class

No comments:

Post a Comment