Latest Movie :

Coding pada Visual Studio

Haii gan..
Di postingan saya kali ini saya ingin berbagi ilmu mengenai materi Visual Studio. Dengan coding-coding yang mungkin bikin pusing waktu kita membuat aplikasi. Di sini saya ingin berbagi coding button Tambah, button Simpan, button Hapus, button Edit, button Batal dan Button untuk menuju form yang di inginkan.

Berikut codingnya:
  1.  Button Login

    If TextBox1.Text = "Admin" And TextBox2.Text = "root" Then
                Me.Hide()
                Form2.Show()
            ElseIf TextBox1.Text = "" And TextBox2.Text = "" Then
                MessageBox.Show("Mohon isi username dan password terlebih dahulu", "PEMBERITAHUAN", MessageBoxButtons.OK, MessageBoxIcon.Information)
            End If





  2.  Untuk mengubah Character pada textfield agar jadi bulat.
    Letakkan cursor pada TextField2 atau TextField untuk input password. Seperti gambar berikut:


    Pada properties PasswordChar yang semula kosong, isi dengan (*) . Tandanya pada TextField Password nanti tampilan hurufnya akan di ganti dengan (*)



  3. Button Tambah / Add
    Private Sub Button_Click(sender As Object, e As EventArgs) Handles Button.Click
            Me.[nama_tabel]BindingSource.AddNew()
        End Sub

  4. Button Simpan / Save
    Private Sub Button_Click(sender As Object, e As EventArgs) Handles Button.Click
            Me.[nama_tabel]BindingNavigatorSaveItem.PerformClick()
        End Sub

  5. Button Hapus / Delete
    Private Sub Button_Click(sender As Object, e As EventArgs) Handles Button.Click
            Me.[nama_tabel]BindingSource.RemoveCurrent()
        End Sub

  6. Button Batal / Cancel
      TextField1.Text = ""
      TextField2.Text = ""
      TextField3.Text = ""
      TextField4.Text = ""

  7. Button Edit
    Private Sub Button_Click(sender As Object, e As EventArgs) Handles Button.Click
            Me.[nama_tabel]BindingSource.EndEdit()
        End Sub

  8. Button Form yang diinginkan
     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Me.Hide()
            Form3.Show()
        End Sub

        Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            Me.Hide()
            Form4.Show()
        End Sub

        Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
            Me.Hide()
            Form5.Show()
        End Sub

        Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
            Me.Hide()
            Form6.Show()
        End Sub

        Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
            Me.Hide()
            Form7.Show()
        End Sub

        Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
            Me.Hide()
            Form8.Show()
        End Sub

        Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
            Me.Hide()
            Form8.Show()
        End Sub



  9. Button Keluar
    Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
            End
        End Sub


    Sekian dulu postingan saya..Tunggu postingan saya selanjutnya
    Semoga bermanfaat :-)
Share this article :

Posting Komentar

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Gustini Qomsyatun - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger