导航:  CWindow Class > Methods and Properties >

Center

上一页返回章节概述下一页

描述

 

将一个窗口放在屏幕上或另一个窗口.它也确保在工作区域内进行布局.

 

FreeBASIC 语法

 

SUB Center ( _

  BYVAL hwnd AS HWND = NULL, _

  BYVAL hwndParent AS HWND = NULL _

)

 

参数

 

hwnd

[in, opt]窗口的句柄.如果NULL,主窗口的句柄使用.

hwndParent

[in, opt]的父窗口的句柄.如果NULL,的桌面窗口工作区坐标进行计算.

 

示例

 

' // Creates the main window

DIM pWindow AS CWindow

pWindow.Create(NULL, "CWindow test", @WndProc)

' // Sizes it by setting the wanted width and height of its client area

pWindow.SetClientSize(500, 320)

' // Centers the window

pWindow.Center

 

引用文件

 

CWindow.inc