Click here to Skip to main content
15,880,972 members
Articles / Programming Languages / Visual Basic
Tip/Trick

Solo Button Application

Rate me:
Please Sign up or sign in to vote.
2.60/5 (4 votes)
19 Apr 2010CPOL 25.2K   2   3
Public Class Form1 '********************************************************************************************************************************* 'I am just printing messagebox 'you can replace this with other calling values 'for eg. Dim com As New OleDbCommand ' ...
VB
Public Class Form1
    '*********************************************************************************************************************************
    'I am just printing messagebox
    'you can replace this with other calling values
    'for eg. Dim com As New OleDbCommand
    '        com.Connection = con
    '        com.CommandText = "insert into members values(" & Val(TextBox1.Text) & ",'" & TextBox2.Text & "','" & _
    '                            TextBox3.Text & "','" & ComboBox1.Text & "'," & CheckBox1.Checked & "," & CheckBox2.Checked & "," & _
    'DateTimePicker1.Text & "," & DateTimePicker2.Text & ",'" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & _
    '"','" & TextBox7.Text & "'," & DateTimePicker3.Text & ",'" & TextBox8.Text & "','" & TextBox9.Text & "')"
    '        com.ExecuteNonQuery()
    '        MsgBox("Record Inserted")
    'same with delete and update & so on......
    '*********************************************************************************************************************************
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
         If Button1.Text = "Add" Then
            MsgBox("Record Inserted")
            Button1.Text = "Update"
        ElseIf Button1.Text = "Update" Then
            MsgBox("Record Modified")
            Button1.Text = "Delete"
        Else
            MsgBox("Record Removed")
            Button1.Text = "Add"
        End If
    End Sub

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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralReason for my vote of 5 It may be real simple, but it's got ... Pin
drummerboy051124-Mar-11 11:24
professionaldrummerboy051124-Mar-11 11:24 
Reason for my vote of 5
It may be real simple, but it's got a good point to it. Really, though, I think this could be posted under "Tips & Tricks"...
GeneralMy vote of 1 Pin
Johnny J.19-Apr-10 21:00
professionalJohnny J.19-Apr-10 21:00 
GeneralMy vote of 1 Pin
SledgeHammer0119-Apr-10 5:02
SledgeHammer0119-Apr-10 5:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.