此處為VisualFreeBasic編程教程(從零開始學或VB進階)的子章節部分,全部目錄點鏈接。
類,自定義類型
type aaa
bb as long
end type
上面只是簡單的應用類型,還可以更多,寫過程,寫函數,寫屬性,就是完整的類
Constructor 和 Destructor (構造函數和析構函數)
type aaa
Declare Constructor ( )
Declare Destructor ( )
end type
Destructor aaa ( )
statements 創建類時運行的代碼
End Destructor
Constructor aaa()
statements 銷毀類時運行的代碼
End Constructor
Private: 和 Public:
type aaa
Public: '表示調用者可以用
bb as long
Private: '表示只是類里的函數使用的全局變量,調用者不可以使用
cc as long
end type
Property 屬性
type CForm
Declare Property hWindow() As HWnd
Declare Property hWindow(ByVal hForm As HWnd)
end type
Property CForm.hWindow() As HWnd
Return m_hWindow
End Property
Property CForm.hWindow(ByVal hForm As HWnd)
If IsWindow(hForm) Then
End If
End Property