source: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab@ 561

Last change on this file since 561 was 561, checked in by イグトランス (egtra), 16 years ago

EditBox, TaskMsgの追加。

File size: 1.1 KB
Line 
1'Classes/ActiveBasic/Windows/UI/Form.ab
2
3#require <Classes/ActiveBasic/Windows/UI/Control.ab>
4#require <Classes/ActiveBasic/Windows/UI/Button.ab>
5
6Namespace ActiveBasic
7Namespace Windows
8Namespace UI
9
10/*!
11@date 2008/07/13
12@brief トップレベルウィンドウを表すクラス。
13@author Egtra
14*/
15
16Class Form
17 Inherits Control
18Public
19 Sub Form()
20 AddMessageEvent(WM_COMMAND, AddressOf (OnCommand))
21 End Sub
22
23Protected
24 Override Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
25 With cs
26 .style = WS_OVERLAPPEDWINDOW
27 .x = CW_USEDEFAULT
28 .y = CW_USEDEFAULT
29 .cx = CW_USEDEFAULT
30 .cy = CW_USEDEFAULT
31 End With
32 End Sub
33
34 Sub OnCommand(sender As Object, e As MessageArgs)
35 Dim id = e.WParam And &hffff 'LOWORD(e.WParam)
36 Dim cmd = (e.WParam >> 16) And &hffff 'HIWORD(e.WParam)
37 Dim hwnd = e.LParam As HWND
38 If cmd = BN_CLICKED And hwnd <> 0 Then
39 Dim c = Control.FromHWnd(hwnd)
40 If IsNothing(c) = False Then
41 Dim b = c As Button
42 b.RaiseClick()
43 End If
44 End If
45 End Sub
46
47#include "FormEvent.sbp"
48End Class
49
50End Namespace 'UI
51End Namespace 'Widnows
52End Namespace 'ActiveBasic
Note: See TracBrowser for help on using the repository browser.