Saturday, November 15, 2008

Belajar Control Objek Foxpro Part 1

Mari belajar men-kontrol objek pada foxpro

Pertama-tama buatlah Project dengan nama Latihan 1. Dan simpan menjadi:
C:\Latihan Foxpro\Latihan1.pjx
disainlah form seperti berikut:
Objek yang dibutuhkan:
Label1
Properties:
  • AutoSize = .T. - True
  • Caption = "Toko Aksesoris Motor"
  • FontSize = 20
  • FontBold = .T. - True
Label2
Properties:
  • AutoSize = .T. - True
  • Caption = "Kode"
Label3
Properties:
  • AutoSize = .T. - True
  • Caption = "Nama"
Label4
Properties:
  • AutoSize = .T. - True
  • Caption = "Harga"
Label5
Properties:
  • AutoSize = .T. - True
  • Caption = "Jumlah"
Label6
Properties:
  • AutoSize = .T. - True
  • Caption = "Total"
Textbox1: Properties:Name=Text1; Textbox2 Properties:Name=Text2;Textbox3: Properties:Name=Text3; Textbox4:Properties:Name=Text4

Textbox5: Properties: Enabled = .F. - False; Name = text5,

Command1:
Properties:
  • Caption:/
Command2:
Properties:
  • Caption:/

Setelah Mendisain baru memberikan perintah kontrol untuk beberapa objek pada form tersebut.
Kasus:
  1. Ketika tombol "Hitung" ditekan, maka pada Total (Text5) akan menampilkan hasil perkalian antara harga * Jumlah
  2. Ketika tombol "Keluar" ditekan, maka program akan keluar
Penyelesaian.
Analisa:
Karena aksi terjadi karena tombol hitung ditekan, maka berikan perintah tersebut pada bagian object tombol "Hitung" yaitu pada

No comments: