Pages

Minggu, 24 Oktober 2010

Transfer item antar listview di Visual Studio 2008

Bisa gak ya kalo transfer item antar listview?? mau coba??
1. Buat design kaya dibawah ini ya




2. Setelah Itu tambahin coding untuk form loadnya ya

With ListBox1.Items
.Add("rujak")
.Add("bakso")
.Add("nasi goreng")
.Add("siomay")
.Add("gado2")
End With

With ListBox2.Items
.Add("teh manis")
.Add("kopi")
.Add("es jeruk")
.Add("aqua")
.Add("es cokelat")
End With

3. Kemudian tambahkan codinh untuk button 1 (untuk pindah), dengan ivent click

If ListBox1.SelectedIndex <> -1 Then
ListBox3.Items.Add("01 - " & ListBox1.SelectedItem)
ListBox1.Items.Remove(ListBox1.SelectedItem)
ElseIf ListBox2.SelectedIndex <> -1 Then
ListBox3.Items.Add("02 - " & ListBox2.SelectedItem)
ListBox2.Items.Remove(ListBox2.SelectedItem)
End If

4. Tambahin coding untuk button 2 (untuk kembali), dengan event click

id = Microsoft.VisualBasic.Left(ListBox3.SelectedItem, 2)
nama = Mid(ListBox3.SelectedItem, 6, Len(ListBox3.SelectedItem))
If id = "01" Then
ListBox1.Items.Add(nama)
ElseIf id = "02" Then
ListBox2.Items.Add(nama)
End If
ListBox3.Items.Remove(ListBox3.SelectedItem)

5. Kemudian yang terakhir tambahin coding untuk listview1 dengan ivent GotFocus

Select Case sender.name
Case ListBox1.Name
ListBox2.SelectedIndex = -1
Case ListBox2.Name
ListBox1.SelectedIndex = -1
End Select

Kalo udah coba dah jalanin, kalo bener hasilnya kaaya dibawah ini :



Terus coba dah pindahin ke listview sebelah



dan yang terakhir coba aja dindah lagi kesebelah, kembaliin ke tempat semula

Program Konversi Suhu - Lengkap

#include
#include
void main()
{
int awal,akhir,c;
float r,f,
clrscr;
cout<<"Nilai Awal :",cin>>awal;
cout<<"Nilai Akhir :",cin>>akhir;
cout<<"Hasil Konversi Celcius ke Reamur ke fahrenhaite dan ke kelvin"< cout<<"|--------------------------------------------------------------|"< cout<<"| celcius | reamur | fahrenhaite | kelvin |"< cout<<"|--------------------------------------------------------------|"< for(c=awal;c<=akhir;c++)
{
r=(0.4*f-32);
f=(1.8*c+32);
k=(2.25*r+273);
c=(k-273);
cout<<"| "< cout<<"|------------------------------------------------------------------|"< }
getch();
}

Materi Premrograman Visual II

Struktur Keputusan dan Perulangan - Klik untuk Download -

Rabu, 13 Oktober 2010

Materi Prak. Sistem Basis Data Kelas Q091

1. Klik Disini Untuk Download Materi 1
2. Klik Disini Untuk Download Materi 2

Selasa, 12 Oktober 2010

Program Konversi Suhu

#include
#include

void main(){
int celcius;
float reamur,faretheit;

cout<<"Masukan suhu dalam derajat Celcius = ";
cin>>celcius;

reamur = (4*celcius)/5;
faretheit = ((9*celcius)/5) + 32;
cout<<"----------------------------------"<cout<<"Suhu dalam reamur adalah : "<cout<<"Suhu dalam Farenheit adalah : "<getch();
}

Contoh Program Sederhana Dengan Borland C++

1. Program Bilangan Genap Ganjil
#include
#include

void main(){
int a;
cout<<"Masukan Bilanga = ";
cin>>a;
if (a%2){
cout<<"Bilangan Ganjil"<}else {
cout<<"Bilangan Genap"<}
getch();
}

Berkenalan Dengan Borland C++

Tipe data pada C++ ada banyak, dan kita harus bisa menggunakan dengan baik sesuai dengan keperluan dari program yang kita buat. Beberapa contoh Tipe data :


Selain itu ada beberapa sintax khusus untuk borland C++, antara lain



---------------------------------------------------------------------

dan berikut adalah program sederhana menggunakan Borland C++

#include
#include

void main(){
cout<<"Nama Saya Gde Muriarka"< cout<<"Saya Mahasiswa STIKOM BALI";

getch();
}

Materi Prak. PTI

Download Materi Praktek PTI - Pertemuan 1 (Pengenalan Komponen Komputer) -click disini -