About Me

Sabtu, 23 Juni 2012

membuat Form Perhitungan Ala Microsoft.Excel



1. Buat Project Baru Standart exe
2.Tambahkan 1 buah TextBox (Text1)
3. Tambahkan 1 buah Label (Label1)
4.Tambahkan 1 Buah CommandButton (Command1) caption : HASIL Perhitungan




Masukkan Code Dibawah INI Di Dalam Form:


Private Const WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_COLORKEY = &H1
Private Const LWA_ALPHA = &H2

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crColor As Long, ByVal nAlpha As Byte, ByVal dwFlags As Long) As Long

Private Sub Command1_Click()
Dim excel_app As Object
Dim excel_sheet As Object

Set excel_app = CreateObject("Excel.Application")

excel_app.Workbooks.Add
If Val(excel_app.Application.Version) >= 8 Then
Set excel_sheet = excel_app.ActiveSheet
Else
Set excel_sheet = excel_app
End If

excel_sheet.Cells(1, 1) = "=" & Text1.Text

Label1.Caption = excel_sheet.Cells(1, 1)
Label1.Caption = Format$(Label1.Caption, "#,##0")

excel_app.ActiveWorkbook.Close False

excel_app.Quit
Set excel_sheet = Nothing
Set excel_app = Nothing
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Command1_Click
End Sub

Selesai Coba Anda ketik 11*20+(31-179) Atau Perkalian Lain Pada Text 1..
 stelah Itu Tekan Button HASIL Perhitungan
pada Label1 akan Terdapat hasil perkalian tersebut!!...
============================
--:>BY AlexCucuMbahGoogle

0 komentar:

Postingan Populer

Diberdayakan oleh Blogger.

Popular Posts

 

Postingan Populer

New Story of My Life

Copyright© 2012 Angelz-Hackedz | Designer by : AlexCucuMbahGoogle |