source: trunk/ab5.0/ablib/TestCase/UI_Sample/step11_TextEditoer.ab@ 575

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

ウィンドウ作成関数を親用のCreateFormと子用のCreateに分離。

File size: 1.1 KB
Line 
1/*!
2@file
3@brief 「Win32プログラミング講座 ~ Step11. テキスト エディタを作る ~」のAB5移植版
4http://www.activebasic.com/help_center/articles/win32/step05/
5まだメニューバーがないんでそれっぽくありません。
6
7@date 2008/07/20
8@auther Egtra
9*/
10
11#require <Classes/ActiveBasic/Windows/UI/Application.ab>
12#require <Classes/ActiveBasic/Windows/UI/Form.ab>
13#require <Classes/ActiveBasic/Windows/UI/EditBox.ab>
14
15#resource "UI_Sample.rc"
16
17Imports ActiveBasic.Windows.UI
18
19Class MyForm
20 Inherits Form
21Public
22 Sub MyForm()
23 AddResize(AddressOf(OnResize))
24 CreateForm()
25 myEdit = New EditBox
26 With myEdit
27 .Create(This, ES_MULTILINE Or ES_WANTRETURN Or ES_AUTOHSCROLL Or ES_AUTOVSCROLL Or WS_HSCROLL Or WS_VSCROLL, WS_EX_CLIENTEDGE)
28 .SendMessage(WM_SETFONT, GetStockObject(DEFAULT_GUI_FONT) As WPARAM, 0)
29 End With
30 Show(SW_SHOWDEFAULT)
31 End Sub
32
33 Sub OnResize(sender As Object, e As ResizeArgs)
34 myEdit.Move(0, 0, e.X, e.Y)
35 End Sub
36Private
37 myEdit As EditBox
38End Class
39
40Control.Initialize(GetModuleHandle(0))
41
42Application.Run(New MyForm)
Note: See TracBrowser for help on using the repository browser.