Tugas kali ini menghubungkan visual basic dengan sql dan ditambah tombol navigasi mulai dari simpan, edit, hapus, next dan lainya secara manual. Untuk itu kita lakukan langkah langkah berikut ini :

  • Buat data di sql server terdiri dari NIM, NAMA, ALAMAT, TANGGAL LAHIR, SPP TETAP
  • Buka visual basic dan buat form baru
  • Pilih pada menu toolbar : 
  •         Data >> Add New Data Souce >> Database >> Dataset >> add new conection
  • isi dingan nama server kita, kemudian klik next sambil menunggu database muncul lalu klik finis
  • Selanjutnnya masukan data tabel ke form.
  • Hapus tombol navigasi otomatis
  • Buat tombol navigasi dengan menggunakan button
  • masukan perintah program ke dalam masing masing tombol
  • jalankan program.
Maka hasilnya akan seperti ini :


Untuk tombol perintah program sebagai berikut :

Tombol Prev



Tombol Next


Tombol Move First


Tombol Move Last


Tombol Add


Tombol Remove


Tombol Save






 Memperbaiki program

Program disamping ternyata ada beberapa kekurangan yaitu hasil nilai terbesar dan kecil terbalik. maka perlu kita perbaiki sehingga hasilnya seperti ini :

if hasil(1)>args(i) Then hasil(1) = args(i)
if hasil(1)<args(i) Then hasil(2) = args(i)
menjadi
if hasil(1)<args(i) Then hasil(1) = args(i)
if hasil(1)>args(i) Then hasil(2) = args(i)

atau bisa juga seperti ini

Textbox1.text = statistik (0)
Textbox1.text = statistik (1)
Textbox1.text = statistik (2)
menjadi
Textbox1.text = statistik (0)
Textbox1.text = statistik (1)

MACAM MACAM FUNCTION BAWAAN

Fungsi-fungsi konversi ke integer.

Ada tiga macam fungsi yang melakukan konversi ke tipe data integer yaitu seperti terlihat pada     tabel .
CInt () ===> Pembuatan nilai desimal 0.5 dan lebih ke integer yang lebih dekat
Fix () ===> Pemotongan suatu nilai desimal menjadi integer
Int () ===> Pembuatan ke bawah suatu nilai desimal
Untuk bilangan positif, fungsi Fix() dan Int() memberikan perlakuan yang sama.
Sebagai contoh, kedua pernyataan berikut ini mengembalikan nilai yang sama
ans1 = Int (14.5) mengembalikan 14
ans2 = Fix (14.5) mengembalikan 14

Namun fungsi Fix() dan Int() memberikan perlakuan berbeda pada bilangan negatif. Kedua pernyataan berikut memberikan pengembalian yang berbeda.
ans1 = Int (-14.5) mengembalikan -15
ans2 = Fix (-14.5) mengembalikan 14

Sedangkan fungsi CInt() mengembalikan pembulatan angka yang terdekat. Berikut ni contoh penggunaan CInt() :
ans1 = CInt (14.1) mengembalikan 14
ans2 = CInt (14.5) mengembalikan 14
ans3 = CInt (14.6) mengembalikan 14
ans2 = CInt (-14.5) mengembalikan -14

Fungsi ’f1’endash Fungsi konversi tipe data
CCur () mengkonversi argumen menjadi tipe data currency
CDbl () mengkonversi argumen menjadi tipe data double (presisi ganda)
CLng () mengkonversi argumen menjadi tipe data long integer
CSng () mengkonversi argumen menjadi tipe data single
CStr () mengkonversi argumen menjadi tipe data string
Ivar () mengkonversi argumen menjadi tipe data variant

Sebagai contoh misalkan sebuah data yang merupakan hasil bagi (1 / 7)
lblNilai = (1 / 7) ditampilkan .1428571
lblNilai = CDbl (1 / 7) ditampilkan .142857142857143

Fungsi-fungsi matematika
Fungsi-fungsi yang bekaitan dengan matematika seperti terlihat pada
Abs () mengembalikan nilai absolut dari argumen
Atn () mengembalikan nilai arc tangen dari argumen dalam bentuk radian
Cos () mengembalikan nilai cosinus dari argumen radian
Exp () mengembalikan nilai exponensial dari argumen
Log () mengembalikan nilai logaritma dari argumen
Sin () mengembalikan nilai sinus dari argumen dalam radian
Sqr () mengembalikan nilai akar dari argumen
Tan () mengembalikan nilai tangen dari argumen dalam radian

Fungsi-fungsi String
Selain fungsi-fungsi numerik, Visual Basic juga mempunyai sejumlah fungsi-fungsi String diantaranya seperti berikut
LCase$ () mengembalikan argumen string sebagai tipe data string huruf
Ucase () mengembalikan argumen string sebagai tipe data variant huruf besar
Ucase$ () mengembalikan argumen string sebagai tipe data string huruf besar
Val () mengembalikan nilai number dari argumen string
Len () mengembalikan nilai sumber yang menunjukan panjang string

Substring merupakan bagian dari suatu string. Untuk memperoleh substring dari suatu string dapat digunakan 3 fungsi berikut :
- Left$(StringVal, length)
  Fungsi ini mengembalikan nilai string dari sebelah kiri sebanyak length karakter .
- Right$(StringVal, length)
  Fungsi ini mengembalikan nilai string dari sebelah kanan sebanyak length karakter .
- Mid$(StringVal, startVal, length)
   Fungsi ini mengembalikan nilai string dari startVal sebanyak length karakter .

Contoh :
HurufKecil = LCase (“Rickie”) ’HurufKecil = “rickie”
HurufBesar = Ucase (“Faizin”) ’HurufBesar = “FAIZIN”
Title = “Apa Kabar”
lTitle = Left$ (Title, 4) ’lTitle = “Halo”
RTitle = Right$ (Title, 5) ’RTitle = “Dunia”
MTitle = Left$ (Title, 2, 6) ’MTitle = “alo Du”
Panjang = Len (“Biru dan hijau”) ’length = 14

Fungsi-fungsi Tanggal dan Waktu
Jika dalam suatu aplikasi diperlukan pengambilan tanggal atau waktu dari sistem, Visual Basic menyediakan fungsi ’endash fungsi Now(), Date(), dan Time().
Fungsi-fungsi Tanggal dan Waktu
Now () mengembalikan tanggal dan waktu sistem
Date () mengembalikan tanggal dari sistem
Time () mengembalikan waktu dari sistem

Selain fungsi-fungsi diatas terdapat sebuah fungsi yaitu format() yang berkaitan dengan fungsi-fungsi Tanggal dan waktu
Format (Expresi [, format[, firstdayofweek[, firstweekofyear]]])
Fungsi ini mengembalikan nilai variant atau string sesuai dengan format yang ditentukan.

Fungsi Date and Time pada VB
Time : mencari tahu waktu saat ini atau menetapkan waktu, tergantung format
pemakaiannya ( lihat contoh di bawah ini)
A$ = Time ’lquote hasil 18:16:35 AM
MyTime = #4:35:17 PM# ’lquote assign a time
Time = MyTime ’lquote set system time to MyTime
Now : merekam tanggal dan waktu sekarang



Dapet tugas visual basic lagi nih. Tugas Kali ini gampang gampang susah.


  • Membuat MDI Form minimal mempunyai form anak 4
  • Membuat menu untuk tampilan tile vertical,tile horizontal,dan tile cascade
  • Mengatur tata leteak menu menu sesuai selera anda 


1.  OKe langsung saja, pertama kita buat Form MDI caranya


  •  Buka program Microsoft Visual Studio 2010, pilih New Project, pilih Windows Form Application
  •  pada Solution Explorer dimana form tadi disimpan sebagai contoh saya menyimpan dengan nama WindowsApplication1 setelah klik kanan pilih Add
  • Lakukan sampai tercipta 5 buah form MDI

  • Kemudian pada form1 masukan code berikut untuk membuat MDI Form :


Form2.MdiParent = Me
Form3.MdiParent = Me
Form4.MdiParent = Me
Form5.MdiParent = Me

Form2.Show()
Form3.Show()
Form4.Show()
Form5.Show()
Maka tampilannya saat dijalankan sebagai berikut :

MDI Form

2. Membuat menu Tile Vertical, Tile Horisontal dan Tile Cascade

Untuk membuat menu Tile Vertical, Tile Horisontal dan Tile Cascade tidak terlalu susah. Pertama buat toolbar yang akan digunakan menampilkan form yang dipanggil sesuai selera kita, Buat 3 ikon untuk tampilan vertical horizontal, dan cascade

Pada form1 ketikan code berikut



namaform.mdiparent=me
namaform.show
Selanjutnya kira masukan kode berikut di masing masing ikon


Ikon Horizontal
Me.LayoutMdi(MdiLayout.TileHorizontal)

Ikon Vertikal
Me.LayoutMdi(MdiLayout.TileVertical)

Ikon Cascade
Me.LayoutMdi(MdiLayout.Cascade)


Dan coba jalan kan form. Maka tampilannya sebagai berikut :

A. Cascade
B. Vertical & C. Horizontal

Yang terakhir kita coba mengatur letak toolbar sesuka kita silakan mau di letakan dimana terserah anda. Berikut tampilan yang saya buat. Terimakasih.

Tampilan dengan menu ikon di bawah ^^






  • Poaches or hard- or soft-boils eggs at touch of a button
  • Egg rack holds 7 eggs; nonstick poaching pan holds 4 eggs
  • Includes measuring cup with egg piercing pin
  • Heat-resistant base; clear cover
  • 1-Year warranty









The 86628 works just fine BUT I bought it based on West Bend's advertized wattage rating of 600W--thinking more is better. In actuality the unit is only rated at 350W. West Bend claims they're changing the misinformation on their site today.
My previous Egg Cooker was an Oster and it was OK.
I prefer my new 86628 because: It's all plastic so the egg holder won't discolor as did the Oster. The water measuring cup allows exact measures not like some others where you add water to the base. The egg holder allows you to remove all the eggs at once and imerse in cooling water so you don't have to handle each egg separately. The 'done' signal is LOUD. I like the positive Off/On switch. Others shut off the unit when cooking is finished. In my opinion that kind of temperature sensitive switching is a weakness. Which is what happened to my Oster. Although the water measuring instructions don't make sence to me, ie: more eggs need less water, I followed the instructions for soft boiling 4 and the eggs were perfect. And AMAZON.com is an excellent way to buy merchandise.


I love poached eggs, and the eggs that you get from the West Bend Cooker are very tasty. However, getting them from this cooker is a exercise in trial-and-error at best.

Starting from the outside, the clear plastic dome lid has the advantage of letting you see your eggs as they cook (or often as not, don't cook...). That is the ONLY advantage it has. The handle "bumps" on each side fit smoothly into the base of the cooker, meaning that nothing on the dome projects out from it.This means that although they are handle-shaped, you can't actually grab on to them. You can pick up the dome lid by simply palming it (if your hands are big enough) but if you've just poached a tray of eggs under it, you then get a burned hand.

Moving on to the poaching tray, it is designed to hold four very TINY eggs. Anything larger than a "medium" egg will overflow the tray and then accumulate in the water reservoir below, which then trips the power switch and the cooker shuts off, leaving you with egg-drop soup in the water reservoir, and uncooked eggs in the poaching tray.

Moving down from the poaching tray, the base tray works fine for making boiled eggs. The accompanying measuring cup also is accurately marked and if you can get around the problems with the lid, and content yourself with poaching only small eggs, you'll enjoy the eggs you get from this cooker.



Very Cheap | Very Wonderfulll
  • 1-1/2-, 2-quart lidded saucepans; 8-, 10-inch skillets; 3-quart lidded saute; 6-quart lidded stockpot
  • Nonstick aluminum in terra cotta; Innovative SandFlow nonstick contains no PTFEs or PFOAs
  • Aluminum exterior heats up quickly and helps reduce hot spots that can cook foods unevenly
  • Dual riveted stainless steel handle with color matching silicone cover; oven safe to 600 degrees
  • Dishwasher safe, though handwashing recommended

I've been very happy with this set, especially the silicone handles as they really do stay cool. They're a huge step up from what we've been using (about 15 year old cheap and rather heavy cookware - hooray for the student life). The only thing I might say is that they are quite easily scratched with metal utensils, probably a no-brainer I know but it was a little easier than I was expecting. Overall I love them though. They are made of aluminum so they are light and cook evenly, and the handles won't burn you.
I am so pleased with the product. I have been a Farberware user for 40 years and my new set is even better than I had expected, and I expected a lot. It is sturdy, easy to clean, heats evenly and is attractive. The price was very fair.

Love the pots and pans. The silicone handles don't get hot and it looks very nice. Cleans very easy and the price is fantastic! No matter where I shopped I couldn't find a better deal than Amazon. Now the down side, When I recieved the pots, on the dutch oven there was a manufactures defect on the bottom of the pot. The shinny, ribbed silver part was incomplete and it had some pretty deep scratches on it. I called the number provided in the Farberware box as directed by farberware and customer service so rudley told me they wont deal with it. Even though it was a manufactures defect, farberware won't honor thier warranty because I got the set off Amazon and they don't carry that set as an open stock item. So now I have to ship the entire package back to amazon to get a replacement of only the dutch oven. Amazon's customer service was great, farberwares on the other hand needs a whole lot of improvement.







Puzzle merupakan permainan yang ada sudah lama sejak zaman dahulu kala. Permainan ini dapat merangsang otak untuk berpikir kritis dalam menyelesaikan masalah. Kali ini saya ingin share tugas pemrogaman visual ke 4 yang ke dua tentan membuat puzzle. Sudah saya cari disana sini tapi tidak ketemu juga akhirnya saya buat sesuai logika saya sendiri. Berikut cara membuat game puzzle menggunakan visual studio 2010  Langkah pertama buka visual basic dan buat form dengan tampilan sebagai berikut :


susunan form tampilan game puzzle

Jika sudah maka tinggal memasukan source code ke setiap tombol. Namun sebelumnya saya akan jelaskan bagaimana cara progam ini berjalan.
  • Tombbol acak berfungsi untuk mengacak angaka 1 – 0 , sekaligus akan menjadi tombol stop saat progam dijalankan
  • Tombol tambah kecepatan berfungsi untuk menambah kecepatan proses pengacakan tombol puzzle. Jika kecepatan sudah sampai maksimum maka muncul pesan “ kecepatan maksimum tercapai”
  • Perpindahan angka hanya bisa dilakukan jika ada tombol kosong disebelah tombol yang isi.  Jika tombol isi di pilih sedang tombol kosong ada disebelahnya maka secara otomatis tombol akan bertukar tempat. Jika sebelahnya isi maka tombol tidak akan bertukar tempat
  • Jika semua tombol sudah terletak pada tempatnya masing masing maka akan muncul “ selamat anda berhasil”

OK paham lah yah... kalo kurang paham main ketempat saya aja nanti saya jelaskan. Pertama kita akan membuat tombol acaknya dahulu, kenapa tidak masukan angkanya aja dulu? Ya terserah saya aja yah... yang penting kan nanti hasilnya.....

Pada tombol acak kita masukan kode berikut

PrivateSubbacak_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handlesbacak.Click
jalan = Notjalan
        Timer1.Enabled = jalan
If Timer1.Enabled = TrueThen
bacak.Text = "STOP"
Else
bacak.Text = "ACAK"
EndIf

EndSub

Lho kok error... ya iya lah itu karena kita belum membuat timer. Timer disini berfungsi untuk mengaca angka secara continyu. Untuk itu kita harus buat object timer. Selanjutnya pada object timer kita masukan kode berikut :


PrivateSub Timer1_Tick(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles Timer1.Tick
DimacakAsInteger
Do
acak = Rnd() * 10
            b1.Text = acak
'  If b1.Text = 10 Or b1.Text = 0 Or b1.Text = 9 Then
'b1.Text = ""
'End If
LoopWhileacak = 10 Oracak = 9

Do
acak = Rnd() * 10
            b2.Text = acak
'If b2.Text = 10 Or b2.Text = 0 Or b2.Text = 9 Then
'b2.Text = ""
' End If

LoopWhile b2.Text = b1.Text Oracak = 10 Oracak = 9


Do
acak = Rnd() * 10
            b3.Text = acak
'   If b3.Text = 10 Or b3.Text = 0 Or b3.Text = 9 Then
'b3.Text = ""
'End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = 10 Oracak = 9

Do
acak = Rnd() * 10
            b4.Text = acak
' If b4.Text = 10 Or b4.Text = 0 Or b4.Text = 9 Then
'b4.Text = ""
' End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = b3.Text Oracak = 10 Oracak = 9

Do
acak = Rnd() * 10
            b5.Text = acak
'If b5.Text = 10 Or b5.Text = 0 Or b5.Text = 9 Then
'b5.Text = ""
'End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = b3.Text Oracak = b4.Text Oracak = 10 Oracak = 9

Do
acak = Rnd() * 10
            b6.Text = acak
'If b6.Text = 10 Or b6.Text = 0 Or b6.Text = 9 Then
'b6.Text = ""
'End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = b3.Text Oracak = b4.Text Oracak = b5.Text Oracak = 10 Oracak = 9

Do
acak = Rnd() * 10
            b7.Text = acak
'If b7.Text = 10 Or b7.Text = 0 Or b7.Text = 9 Then
'b7.Text = ""
'End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = b3.Text Oracak = b4.Text Oracak = b5.Text Oracak = b6.Text Oracak = 10 Oracak = 9



Do
acak = Rnd() * 10
            b8.Text = acak
'            If b8.Text = 10 Or b8.Text = 0 Or b8.Text = 9 Then
'b8.Text = ""
'End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = b3.Text Oracak = b4.Text Oracak = b5.Text Oracak = b6.Text Oracak = b7.Text Oracak = 10 Oracak = 9


Do
acak = Rnd() * 10
            b9.Text = acak
' If b9.Text = 10 Or b9.Text = 0 Or b9.Text = 9 Then
'b9.Text = ""
'End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = b3.Text Oracak = b4.Text Oracak = b5.Text Oracak = b6.Text Oracak = b7.Text Oracak = b8.Text Oracak = 10 Oracak = 9


Dim control AsWindows.Forms.Control
ForEach control InMe.Controls
Ifcontrol.Text = "0"Then
control.Text = ""
EndIf
Next

EndSub


Sekarang kita coba jalankan maka hasilnya button 1 sampai 9 telah terisi angka, sebenarnya ada cara yang lebih mudah yaitu dengan menggunakan array tapi pakai cara yang susah aja dulu biar jalan logikanya. Berikut tampilan progamnya ketika diacak

Ketika tombol stop di hentikan maka proses acak akan berhenti dan tombol stop akan berubah menjadi tombol acak lagi. Setelah kita dapat mengacak angka maka sekarang kita tinggal membuat perintah agar tombol mau berpindah tempat. Sebagai contoh ketika tombol acak dihentikan maka tampilannya akan sebagai berikut. Saat angka 7 kita klik maka angka 7 akan berpindah ke tengah dan tombol kosong akan berpindah ke bawah.


Agar dapat berjalan seperti diatas maka kita akan tambahkann perintah disetiap button 1 sampai 9, berikut kode perintahnya. 



PrivateSub b1_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b1.Click
If b2.Text = ""Then
            b2.Text = b1.Text
            b1.Text = ""
EndIf
If b4.Text = ""Then
            b4.Text = b1.Text
            b1.Text = ""
EndIf
EndSub

PrivateSub b2_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b2.Click
If b1.Text = ""Then
            b1.Text = b2.Text
            b2.Text = ""
EndIf
If b5.Text = ""Then
            b5.Text = b2.Text
            b2.Text = ""
EndIf
If b3.Text = ""Then
            b3.Text = b2.Text
            b2.Text = ""
EndIf

EndSub

PrivateSub b3_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b3.Click
If b2.Text = ""Then
            b2.Text = b3.Text
            b3.Text = ""
EndIf
If b6.Text = ""Then
            b6.Text = b3.Text
            b3.Text = ""
EndIf

EndSub

PrivateSub b4_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b4.Click
If b1.Text = ""Then
            b1.Text = b4.Text
            b4.Text = ""
EndIf
If b5.Text = ""Then
            b5.Text = b4.Text
            b4.Text = ""
EndIf
If b7.Text = ""Then
            b7.Text = b4.Text
            b4.Text = ""
EndIf
EndSub

PrivateSub b5_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b5.Click
If b2.Text = ""Then
            b2.Text = b5.Text
            b5.Text = ""
EndIf
If b4.Text = ""Then
            b4.Text = b5.Text
            b5.Text = ""
EndIf
If b6.Text = ""Then
            b6.Text = b5.Text
            b5.Text = ""
EndIf
If b8.Text = ""Then
            b8.Text = b5.Text
            b5.Text = ""
EndIf
EndSub

PrivateSub b6_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b6.Click
If b3.Text = ""Then
            b3.Text = b6.Text
            b6.Text = ""
EndIf
If b5.Text = ""Then
            b5.Text = b6.Text
            b6.Text = ""
EndIf
If b9.Text = ""Then
            b9.Text = b6.Text
            b6.Text = ""
EndIf

EndSub

PrivateSub b7_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b7.Click
If b4.Text = ""Then
            b4.Text = b7.Text
            b7.Text = ""
EndIf
If b8.Text = ""Then
            b8.Text = b7.Text
            b7.Text = ""
EndIf
EndSub

PrivateSub b8_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b8.Click
If b5.Text = ""Then
            b5.Text = b8.Text
            b8.Text = ""
EndIf
If b9.Text = ""Then
            b9.Text = b8.Text
            b8.Text = ""
EndIf
If b7.Text = ""Then
            b7.Text = b8.Text
            b8.Text = ""
EndIf

EndSub

PrivateSub b9_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b9.Click
If b8.Text = ""Then
            b8.Text = b9.Text
            b9.Text = ""
EndIf
If b6.Text = ""Then
            b6.Text = b9.Text
            b9.Text = ""
EndIf
If (b1.Text = "1"And b2.Text = "2"And b3.Text = "3"And b4.Text = "4"And b5.Text = "5"And b6.Text = "6"And b7.Text = "7"And b8.Text = "8"And b9.Text = "") Then
MsgBox("selamatandaberhasil")

EndIf

EndSub




Pada button 9 kita beri perintah untuk menampilkan kotak dialog “ selamat anda berhasil” jika kita dapat menyelesaikan puzzle yang kita buat. Karena sudah pasti ketika kita menyelesaikan puzzle maka tombol ke 9 akan di tekan terakhir kali...




Demikian cara membuat game puzzle sederhana dengan visual studio. Eh... ada yang kurang... itu tombol tambah kecepatannya. Sebenarnya tidak terlalu penting si hanya sbagai pelengkap saja. Tombol tambah kecepatan hanya berfungsi untuk mengubah nilai interval pada timer sampai nilai tertentu.



Jika kecepatan sudah maksimum maka akan muncul pesan “ kecepatan maksimum tercapai “ untuk itu kita perlu menambahkan perintah pada botton tambah kecepatan sbagai berikut



PrivateSub Button1_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles Button1.Click
        Timer1.Interval = Timer1.Interval / 2
If Timer1.Interval < 32 Then
MsgBox("kecepatanmaksimumtercapai")
            Timer1.Interval = 15


Demikian progam yang saya buat untuk melengkapi tugas pemrogaman sebelumnya semoga bermanfaat. Untuk source kode selengkapnya dapat dilihat dibawah ini.



PublicClassForm1
DimjalanAsBoolean = False

PrivateSub b1_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b1.Click
If b2.Text = ""Then
            b2.Text = b1.Text
            b1.Text = ""
EndIf
If b4.Text = ""Then
            b4.Text = b1.Text
            b1.Text = ""
EndIf
EndSub

PrivateSub b2_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b2.Click
If b1.Text = ""Then
            b1.Text = b2.Text
            b2.Text = ""
EndIf
If b5.Text = ""Then
            b5.Text = b2.Text
            b2.Text = ""
EndIf
If b3.Text = ""Then
            b3.Text = b2.Text
            b2.Text = ""
EndIf

EndSub

PrivateSub b3_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b3.Click
If b2.Text = ""Then
            b2.Text = b3.Text
            b3.Text = ""
EndIf
If b6.Text = ""Then
            b6.Text = b3.Text
            b3.Text = ""
EndIf

EndSub

PrivateSub b4_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b4.Click
If b1.Text = ""Then
            b1.Text = b4.Text
            b4.Text = ""
EndIf
If b5.Text = ""Then
            b5.Text = b4.Text
            b4.Text = ""
EndIf
If b7.Text = ""Then
            b7.Text = b4.Text
            b4.Text = ""
EndIf
EndSub

PrivateSub b5_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b5.Click
If b2.Text = ""Then
            b2.Text = b5.Text
            b5.Text = ""
EndIf
If b4.Text = ""Then
            b4.Text = b5.Text
            b5.Text = ""
EndIf
If b6.Text = ""Then
            b6.Text = b5.Text
            b5.Text = ""
EndIf
If b8.Text = ""Then
            b8.Text = b5.Text
            b5.Text = ""
EndIf
EndSub

PrivateSub b6_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b6.Click
If b3.Text = ""Then
            b3.Text = b6.Text
            b6.Text = ""
EndIf
If b5.Text = ""Then
            b5.Text = b6.Text
            b6.Text = ""
EndIf
If b9.Text = ""Then
            b9.Text = b6.Text
            b6.Text = ""
EndIf

EndSub

PrivateSub b7_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b7.Click
If b4.Text = ""Then
            b4.Text = b7.Text
            b7.Text = ""
EndIf
If b8.Text = ""Then
            b8.Text = b7.Text
            b7.Text = ""
EndIf
EndSub

PrivateSub b8_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b8.Click
If b5.Text = ""Then
            b5.Text = b8.Text
            b8.Text = ""
EndIf
If b9.Text = ""Then
            b9.Text = b8.Text
            b8.Text = ""
EndIf
If b7.Text = ""Then
            b7.Text = b8.Text
            b8.Text = ""
EndIf

EndSub

PrivateSub b9_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles b9.Click
If b8.Text = ""Then
            b8.Text = b9.Text
            b9.Text = ""
EndIf
If b6.Text = ""Then
            b6.Text = b9.Text
            b9.Text = ""
EndIf
If (b1.Text = "1"And b2.Text = "2"And b3.Text = "3"And b4.Text = "4"And b5.Text = "5"And b6.Text = "6"And b7.Text = "7"And b8.Text = "8"And b9.Text = "") Then
MsgBox("selamatandaberhasil")

EndIf

EndSub

PrivateSubbacak_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handlesbacak.Click
jalan = Notjalan
        Timer1.Enabled = jalan
If Timer1.Enabled = TrueThen
bacak.Text = "STOP"
Else
bacak.Text = "ACAK"
EndIf

EndSub



PrivateSub Timer1_Tick(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles Timer1.Tick
DimacakAsInteger
Do
acak = Rnd() * 10
            b1.Text = acak
'  If b1.Text = 10 Or b1.Text = 0 Or b1.Text = 9 Then
'b1.Text = ""
'End If
LoopWhileacak = 10 Oracak = 9

Do
acak = Rnd() * 10
            b2.Text = acak
'If b2.Text = 10 Or b2.Text = 0 Or b2.Text = 9 Then
'b2.Text = ""
' End If

LoopWhile b2.Text = b1.Text Oracak = 10 Oracak = 9


Do
acak = Rnd() * 10
            b3.Text = acak
'   If b3.Text = 10 Or b3.Text = 0 Or b3.Text = 9 Then
'b3.Text = ""
'End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = 10 Oracak = 9

Do
acak = Rnd() * 10
            b4.Text = acak
' If b4.Text = 10 Or b4.Text = 0 Or b4.Text = 9 Then
'b4.Text = ""
' End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = b3.Text Oracak = 10 Oracak = 9

Do
acak = Rnd() * 10
            b5.Text = acak
'If b5.Text = 10 Or b5.Text = 0 Or b5.Text = 9 Then
'b5.Text = ""
'End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = b3.Text Oracak = b4.Text Oracak = 10 Oracak = 9

Do
acak = Rnd() * 10
            b6.Text = acak
'If b6.Text = 10 Or b6.Text = 0 Or b6.Text = 9 Then
'b6.Text = ""
'End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = b3.Text Oracak = b4.Text Oracak = b5.Text Oracak = 10 Oracak = 9

Do
acak = Rnd() * 10
            b7.Text = acak
'If b7.Text = 10 Or b7.Text = 0 Or b7.Text = 9 Then
'b7.Text = ""
'End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = b3.Text Oracak = b4.Text Oracak = b5.Text Oracak = b6.Text Oracak = 10 Oracak = 9



Do
acak = Rnd() * 10
            b8.Text = acak
'            If b8.Text = 10 Or b8.Text = 0 Or b8.Text = 9 Then
'b8.Text = ""
'End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = b3.Text Oracak = b4.Text Oracak = b5.Text Oracak = b6.Text Oracak = b7.Text Oracak = 10 Oracak = 9


Do
acak = Rnd() * 10
            b9.Text = acak
' If b9.Text = 10 Or b9.Text = 0 Or b9.Text = 9 Then
'b9.Text = ""
'End If
LoopWhileacak = b1.Text Oracak = b2.Text Oracak = b3.Text Oracak = b4.Text Oracak = b5.Text Oracak = b6.Text Oracak = b7.Text Oracak = b8.Text Oracak = 10 Oracak = 9


Dim control AsWindows.Forms.Control
ForEach control InMe.Controls
Ifcontrol.Text = "0"Then
control.Text = ""
EndIf
Next



EndSub


PrivateSub Button1_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles Button1.Click
        Timer1.Interval = Timer1.Interval / 2
If Timer1.Interval < 32 Then
MsgBox("kecepatanmaksimumtercapai")
            Timer1.Interval = 15

EndIf

EndSub

PrivateSub Label1_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs)

EndSub
EndClass













Diberdayakan oleh Blogger.