B
balaschen
Unregistered / Unconfirmed
GUEST, unregistred user!
在Form上放一按扭,onclick事件写如下代码:<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> dwStyleWord;<br> FEditWnd:HWND;<br> TextRect:TRect;<br>begin<br> dwStyle := WS_VISIBLE or WS_CHILD or ES_MULTILINE or ES_LEFT or ES_AUTOVSCROLL;<br> dwStyle:=dwStyle or ES_WANTRETURN;<br> FEditWnd := CreateWindow('EDIT', '', dwStyle, 0, 0, 0, 0, Handle, 0, hInstance, nil);<br> TextRect:=Rect(10,10,60,80);<br> MoveWindow(FEditWnd,TextRect.left,TextRect.Top,TextRect.Right-TextRect.Left,TextRect.Bottom-TextRect.Top,True);<br> ShowWindow(FEditWnd, SW_SHOWNORMAL);<br> Windows.SetFocus(FEditWnd);<br>end;<br>为什么创建的Edit编辑框无法用左右键和回车键??