Senin, 23 Januari 2012

Mempercantik Tampilan Form Pada Visual Basic

Script Mempercantik Tampilan Form - Di Visual Basic :



Declare Function FlashWindow Lib "USER32" _
(ByVal HWND As Long, BYVALBINVERT As Long) As Long

Private Sub Form_Load()
Timer1.Interval = 100
End Sub

Private Sub Timer1_Timer()
Dim nRetrunValue As Long
nRetrunValue = FlashWindow(Form1.HWND, True)
End Sub


--- Next
Private Sub Form_Load()
Timer1.Interval = 100
End Sub


Private Sub Timer1_Timer()
If Form1.Visible = True Then
Form1.Visible = False
Else
Form1.Visible = True
End If
End Sub


--- Next
Private Sub Combo1_Click()
If Combo1.Text = "No Drop" Then
Form1.MousePointer = 12
Else
If Combo1.Text = "Hourglass" Then
Form1.MousePointer = 11
Else
If Combo1.Text = "Up Arrow" Then
Form1.MousePointer = 10
End If
End If
End If
End Sub


--- Next
Private Sub Form_Load()
Combo1.Text = "Pilihan Kursor"
Form1.MousePointer = 1
Combo1.MousePointer = 13
Combo1.AddItem "No Drop"
Combo1.AddItem "Hourglass"
Combo1.AddItem "Up Arrow"


--- Next
Private Sub Form_Load()
Label1.ToolTipText = "Ini Label"
Command1.ToolTipText = "Ini Command"
Timer1.Interval = 100
End Sub

Private Sub Timer1_Timer()
If Label1.ToolTipText = "Ini Label" Then
Label1.ToolTipText = "Label"
Else
If Label1.ToolTipText = "Label" Then
Label1.ToolTipText = "Ini"
Else
Label1.ToolTipText = "Ini Label"
If Command1.ToolTipText = "Ini Command" Then
Command1.ToolTipText = "Command"
Else
If Command1.ToolTipText = "Command" Then
Command1.ToolTipText = "Ini"
Else
Command1.ToolTipText = "Ini Command"
End If
End If
End If
End If
End Sub



--- Next
Dim blnDrag As Boolean
Dim xClickPos, yClickPos

Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X - xClickPos
Source.Top = Y - yClickPos
End Sub
Private Sub command2_Click()
If blnDrag = False Then
blnDrag = True
Command2.Caption = "Drag Aktif "
Else
blnDrag = False
Command2.Caption = "Drag Tidak Aktif"
End If
End Sub

Private Sub Command2_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
If State = 0 Then
Source.MousePointer = 12
ElseIf State = 1 Then
Source.MousePointer = 0
End If
End Sub


--- Next
 Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Private Declare Sub ReleaseCapture Lib "user32" ()
Const HTCAPTION = 2
Const WM_NCLCOMMANDBUTTONDOWN = &HA1

Private Sub Command1_MouseMove(CommandButton As Integer, Shift As Integer, X As Single, Y As Single)
Dim lngRetrunValue As Long
If CommandButton = 1 Then
Call ReleaseCapture
lngRetrunValue = SendMessage(Form1.hwnd, _
WM_NCLCOMMANDBUTTONDOWN, HTCAPTION, 0&)
End If
Command1.Caption = "Klik Disini"
End Sub


'LISTING PADA FORM INI JUGA BISA DIPERGUNAKAN
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim lngRetrunValue As Long
Call ReleaseCapture
lngRetrunValue = SendMessage(Form1.hwnd, _
WM_NCLCOMMANDBUTTONDOWN, HTCAPTION, 0&)
End Sub



--- Next
Private Sub Command1_MouseMove(CommandButton As Integer, Shift As Integer, X As Single, Y As Single)
Command1.BackColor = vbBlue
End Sub

Private Sub Command2_MouseMove(CommandButton As Integer, Shift As Integer, X As Single, Y As Single)
Command2.BackColor = vbYellow
End Sub

Private Sub Command3_MouseMove(CommandButton As Integer, Shift As Integer, X As Single, Y As Single)
Command3.BackColor = vbRed
End Sub

Private Sub Form_MouseMove(CommandButton As Integer, Shift As Integer, X As Single, Y As Single)
Command1.BackColor = vbWhite
Command2.BackColor = vbWhite
Command3.BackColor = vbWhite
End Sub;



--- Next

Option Explicit

Private Sub Form_KeyPress(KeyAscii As Integer)
    Unload Me
    Form1.Show
End Sub

Private Sub Form_Load()
lblLicenseTo.Caption = "<<^.^ Jaja Jamaludin Malik ^.^>>"
lblCompanyProduct.Caption = "Malcomp Technology"
lblProductName.Caption = "E-learning Komputer With VB"
lblProductName.FontSize = 12
lblPlatform.Caption = "For 9x Or XP"
lblVersion.Caption = "1.0"
lblCopyright.Caption = ">>Malcomp Technologi<<"
lblCompany.Caption = ""
lblWarning.Caption = "HAK CIPTA ^^MILIK BERSAMA^^"
End Sub

Private Sub Frame1_Click()
    Unload Me
    Form1.Show
End Sub



--- Next
'SEBELUMNYA BERI NILAI FALSE PADA PROPERTI CONTROLBOX
Private Sub Form_Click()
End
End Sub



--- Next
Private Sub Form_Load()
Label1.Caption = "Ini Mouse Saya"
Label1.Visible = False
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.Left = Str(X)
Label1.Top = Str(Y)
Label1.Visible = True
End Sub


--- Next
Dim a As Integer
Private Sub Form_Load()
Timer1.Interval = 200
Label1.Caption = "Ini"
Label1.Visible = False
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.Left = Str(X)
Label1.Top = Str(Y)
Label1.Visible = True
End Sub

Private Sub Timer1_Timer()
a = a + 1
Select Case a
Case 0
Label1.Caption = "Ini"
Case 2
Label1.Caption = "Mouse"
Case 3
Label1.Caption = "Saya"
Case 4
Label1.Caption = "OK"
End Select
If a >= 4 Then
a = -1
End If
End Sub


--- Next
Private Sub Form_Load()
Me.FontBold = True
Me.FontName = "Comic Sans MS"
Me.BackColor = vbBlack
End Sub

Private Sub Form_Paint()
Me.CurrentX = 80
Me.CurrentY = 80
Me.FontSize = 24
Me.ForeColor = vbWhite
Print "Andi Offset Yogyakarta"
Me.CurrentX = 40
Me.CurrentY = 40
Me.FontSize = 24
Me.ForeColor = vbBlack
Print "Andi Offset Yogyakarta"
Me.CurrentX = 20
Me.CurrentY = 20
Me.FontSize = 24
Me.ForeColor = vbRed
Print "Andi Offset Yogyakarta"
End Sub



--- Next
Private Sub Form_Load()
Timer1.Interval = 500
End Sub

Private Sub Form_Unload(Cancel As Integer)
Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
'untuk kontrol CommandButton rubah dahulu properti style menjadi 1
Command1.BackColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
Label1.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
Check1.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
End Sub

0 komentar:

Posting Komentar

:a: :b: :c: :d: :e: :f: :g:
:h: :i: :j: :k: :l: :m: :n: :o: :p:

 
Design by Puskom Corporation Software | Bloggerized by Author's By : Indro Dwi Saputro - Copyright 2012