![]() |
|
BeLaJar VB Di Thread iNi - Printable Version +- HN-Community (https://hacker-newbie.org) +-- Forum: Miscellaneous (https://hacker-newbie.org/forum-86.html) +--- Forum: Coding/Programing (https://hacker-newbie.org/forum-19.html) +---- Forum: Visual Basic (VB) (https://hacker-newbie.org/forum-68.html) +---- Thread: BeLaJar VB Di Thread iNi (/thread-2176.html) |
BeLaJar VB Di Thread iNi - Jacket^Cyber - 02-22-2010 oke..yg MAu beLaJar VB..diMari teMpatnya.. 1. Pengertian VB Code: Microsoft Visual Basic (sering disingkat sebagai VB saja) merupakan sebuah bahasa pemrograman yang
bersifat event driven dan menawarkan Integrated Development Environment (IDE) visual untuk membuat program aplikasi berbasis sistem operasi Microsoft Windows dengan menggunakan model pemrograman Common Object Model (COM). Visual Basic merupakan turunan bahasa BASIC dan menawarkan pengembangan aplikasi komputer berbasis grafik dengan cepat, akses ke basis data menggunakan Data Access Objects (DAO), Remote Data Objects (RDO), atau ActiveX Data Object (ADO), serta menawarkan pembuatan kontrol ActiveX dan objek ActiveX. Beberapa bahasa skrip seperti Visual Basic for Applications (VBA) dan Visual Basic Scripting Edition (VBScript), mirip seperti halnya Visual Basic, tetapi cara kerjanya yang berbeda.
Para programmer dapat membangun aplikasi dengan menggunakan komponen-komponen yang disediakan oleh Microsoft Visual Basic Program-program yang ditulis dengan Visual Basic juga dapat menggunakan Windows API, tapi membutuhkan deklarasi fungsi eksternal tambahan.
Dalam pemrograman untuk bisnis, Visual Basic memiliki pangsa pasar yang sangat luas. Dalam sebuah survey yang dilakukan pada tahun 2005, 62% pengembang perangkat lunak dilaporkan menggunakan berbagai bentuk Visual Basic, yang diikuti oleh C++, JavaScript, C#, dan Java.2. OBject di VB Code: Fields and Properties
Fields and properties represent information stored in an object. You retrieve and set their values with assignment statements the same way you retrieve and set local variables in a procedure. The following example retrieves the Width property and sets the ForeColor property of a Label object.
Dim warningWidth As Integer = warningLabel.Width
warningLabel.ForeColor = System.Drawing.Color.Red
Note that a field is also called a member variable.
For more information, see Property Procedures vs. Fields.
Methods
A method is an action that an object can perform. For example, Add is a method of the ComboBox object that adds a new entry to a combo box.
The following example demonstrates the Start method of a Timer object.
Dim safetyTimer As New System.Windows.Forms.Timer
safetyTimer.Start()
Note that a method is simply a procedure that is exposed by an object.
For more information, see How to: Perform Actions with Methods.
Events
An event is an action recognized by an object, such as clicking the mouse or pressing a key, and for which you can write code to respond. Events can occur as a result of a user action or program code, or they can be caused by the system. Code that signals an event is said to raise the event, and code that responds to it is said to handle it.
You can also develop your own custom events to be raised by your objects and handled by other objects. For more information, see Events and Event Handlers.
Instance Members and Shared Members
When you create an object from a class, the result is an instance of that class. Members that are not declared with the Shared (Visual Basic) keyword are instance members, which belong strictly to that particular instance. An instance member in one instance is independent of the same member in another instance of the same class. An instance member variable, for example, can have different values in different instances.
Members declared with the Shared keyword are shared members, which belong to the class as a whole and not to any particular instance. A shared member exists only once, no matter how many instances of its class you create, or even if you create no instances. A shared member variable, for example, has only one value, which is available to all code that can access the class.
IntelliSense Listing of Members
IntelliSense lists members of a class when you invoke its List Members option, for example when you type a period (.) as a member-access operator. If you type the period following the name of a variable declared as an instance of that class, IntelliSense lists all the instance members and none of the shared members. If you type the period following the class name itself, IntelliSense lists all the shared members and none of the instance members. For more information, see Using IntelliSense.Sumber : http://msdn.microsoft.com/en-us/library/d887ccss%28VS.80%29.aspx udah aH pembukanya..segitu aJa yah.. Lets sTart.. 1. Coding Awal ini gamBarnya.. http://upload.kapanlagi.com/h/20100222192436_Awal_4b827784c1b75.jpg keterangan : - warna Hitam: OBject Properties disitu adaLah isian2 dari obJect yg kita punya..kita ngatur nama dari obJect,warna dari obJect,dan Lain2nya disitu.. - warna Merah : Project Explorer disitu adalah tampilan dari Form2 yang telah kita buat.. - warna Biru : Toolbar disitu adaLah tempat oBJect2 VB yg bisa kita gunakan.. tidak hanya itu obJectnya..kita bisa menambahkannya dengan menekan CTRL + T - warna Kuning : Lembar kerja disitu adaLah lembaran kerja kita..bisa kita tambahkan dengan obJect2 sesuai kita..untuk memberikan sebuah Coding..dengan cara menekan klik 2x pada oBJect yg ingin kita berikan coding.. sekian penJelasan mengenai gambar.. Masuk coding.. yg Perlu disiapkan : - 1 Form - 3 Text Box -> name : txtnil1,txtnil2,txtnilakhir [ klik di masing2 textbox liat di obJect properties ada bacaan name ] - 4 command Button -> name : cmdtambah , cmdkali, cmdkurang, cmdbagi oke..double klik di cmdtambah kasih coding ini : Code: txtnilakhir=val(txtnil1.text) + val(txtnil2.text)penjelasan : txtnilakhir : tempat akan ditampilkannya proses penjumlahan val(txtnil1.text) dan val(txtnil2.text) : itu ada lah textbox yg ingin kita Jumlahkan..mengapa dikasih coding val..??karena,kita hanya ingin mengambil nilainya saja..[b]value[/b] kalau kita tidak memberikan val,maka dia akan menjumlahkan sebuah STRING..bukan angka yg dijumlahkan.. untuk yg cmdkali,cmdbagi dan cmdkurang..scriptnya sama saja..tinggal mengganti tanda (+) dengan tanda (*),(/) dan (-) tanpa tanda kurung.. penJelasannya sama.. sekian peLaJaran pertama..koreksi kaLo ada salah.. oke..Lanjut dibawahnya.. RE: BeLaJar VB Di Thread iNi - dopunk - 02-22-2010 manteb om..... RE: BeLaJar VB Di Thread iNi - boyman - 02-22-2010 nyian ternyata terren.jr master vb RE: BeLaJar VB Di Thread iNi - Jacket^Cyber - 02-22-2010 oke.. buat tampiLan sepeRti ini : http://upload.kapanlagi.com/h/20100222194617_Program_4b827c9978785.jpg Namenya ada aPa aja ?? neh codingnya..copas ajah.. Code: Private Sub chitung_Click()
takhir.Text = ((Val(tuts.Text) + Val(tuas.Text)) / 2)
If (Val(takhir.Text) > 80) Then
tgrade.Text = "A"
ElseIf (Val(takhir.Text) > 70) Then
tgrade.Text = "B"
ElseIf (Val(takhir.Text) > 60) Then
tgrade.Text = "C"
ElseIf (Val(takhir.Text) > 50) Then
tgrade.Text = "D"
Else
tgrade.Text = "E"
End If
End Sub
Private Sub ckeluar_Click()
End
End Sub
Private Sub clagi_Click()
tnama.Text = ""
tuts.Text = ""
tuas.Text = ""
takhir.Text = ""
tgrade.Text = ""
tnama.SetFocus
End Sub
Private Sub Form_Load()
takhir.Enabled = False
tgrade.Enabled = False
End Sub
Private Sub tnama_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
tuts.SetFocus
End If
End Sub
Private Sub tuas_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
chitung.SetFocus
End If
End Sub
Private Sub tuts_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
tuas.SetFocus
End If
End SubkeTerangan coding : 1. chitung Code: Private Sub chitung_Click()
takhir.Text = ((Val(tuts.Text) + Val(tuas.Text)) / 2)
If (Val(takhir.Text) > 80) Then
tgrade.Text = "A"
ElseIf (Val(takhir.Text) > 70) Then
tgrade.Text = "B"
ElseIf (Val(takhir.Text) > 60) Then
tgrade.Text = "C"
ElseIf (Val(takhir.Text) > 50) Then
tgrade.Text = "D"
Else
tgrade.Text = "E"
End If
End Subuntuk val udah ngertikan ?? ini Logikan Jika takhir > 80 maka dia dapet grade (tgrade.text) akan terisi A..knP harus pake tanda "" karena dia merupakan sebuah STRING..begitu seLanjutnya.. 2. cLagi Code: Private Sub clagi_Click()
tnama.Text = ""
tuts.Text = ""
tuas.Text = ""
takhir.Text = ""
tgrade.Text = ""
tnama.SetFocus
End Sub3. Form Load Code: Private Sub Form_Load()
takhir.Enabled = False
tgrade.Enabled = False
End Sub4. tnama Code: Private Sub tnama_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = 13 Then
tuts.SetFocus
End If
End SubFungsi dari keypress adalah kondisi saat user menekan tomboL di keyboard.. keyascii=13 -> saat user menekan tombol ENTER sekian tutor Jelek dari sayah.. koreksi kaLo ada salah.. kalo ada yg mau nambahin silahkan.. RE: BeLaJar VB Di Thread iNi - K4pT3N - 02-22-2010 Wah, ilmunya keluar juga bro Terren.. Mantap..mantap.. Lanjut lagi bro.. * K4pT3N nyimak... RE: BeLaJar VB Di Thread iNi - Jacket^Cyber - 02-22-2010 Jgn cuma nyimAk bRo.. bAntu aNe Lah..sebarkan iLmu yg di Punya..agar iLmu terus bertambah.. hehehe.. semua yang tak tuLIs ada di siini.. http://www.4shared.com/file/227373134/76124dd8/Program_Sederhana_TA.html Cara Membuat Program LAngsung Nongol Di STARTUP : ini codenya : Code: shell "reg add hkcu\software\microsoft\windows\currentversion\run /t REG_SZ /v Program_apa /d PAthnya_bos",vbhidekeTerangan : kita menggunakan Fungsi shell dari bawaan VB-nya sendiri.. program_apa : nama Program yg ingin kita buat startup (bebas isinya) Pathnya_bos : Path Program kalian koreksi kaLo salah.. Coding Menghapus DataBase dalam 1 kali klik : ini codenya : Code: Private Sub Command1_Click()
If Not (Data1.Recordset Is Nothing) Then
While Not Data1.Recordset.EOF
Data1.Recordset.Delete
Data1.Recordset.MoveNext
Wend
End If
End Subketerangan : data1 : tempat koneksi database yg kita punya.. If Not (Data1.Recordset Is Nothing) Then : jika data1 isinya tidak kosong maka diakan menjalankan perintah dibawahnya.. yaitu coding perulangan.. While Not Data1.Recordset.EOF : Jika data1 tidak diakhir data..kemudian dia akan menjalankan yg dibawahnya Lagi..apakah itu..?? Data1.Recordset.Delete Data1.Recordset.MoveNext Coding Menghapus DataBase dalam 1 kali klik : ini codenya : Code: Private Sub Command1_Click()
If Not (Data1.Recordset Is Nothing) Then
While Not Data1.Recordset.EOF
Data1.Recordset.Delete
Data1.Recordset.MoveNext
Wend
End If
End Subketerangan : data1 : tempat koneksi database yg kita punya.. If Not (Data1.Recordset Is Nothing) Then : jika data1 isinya tidak kosong maka diakan menjalankan perintah dibawahnya.. yaitu coding perulangan.. While Not Data1.Recordset.EOF : Jika data1 tidak diakhir data..kemudian dia akan menjalankan yg dibawahnya Lagi..apakah itu..?? Data1.Recordset.Delete : dia akan menghapus Data1.Recordset.MoveNext : dia akan berlanjut ke record berikutnya sampai dia selesai koreksi kaLo salah.. RE: BeLaJar VB Di Thread iNi - ./rafaelHN - 02-22-2010 hayah ini dia yg gue tggu akhirny tread visual basic nie pengen belajar karna aq masi buta kale ma visual basic dari yg dasar sekali atau vb basic mohon pencerahanny yah bng teren RE: BeLaJar VB Di Thread iNi - Jacket^Cyber - 02-22-2010 tHRead ini di khususkan unTuk taNya Jawab koq.. aNe akan sHare seMua VB yg aNe tAu.. beseRta keTerangnnya.. RE: BeLaJar VB Di Thread iNi - abu adam - 02-22-2010 akhirnya keluar juga ilmu vb nya, skalian share pembuatan virus pake VB om Terren biar mangtabz
RE: BeLaJar VB Di Thread iNi - Jacket^Cyber - 02-22-2010 waduuhh.. ntar duLu kaLo buat viRus..sTandard2 aJa duLu om aBu.. biAr paham duLu dah.. okeh ?? |