怎么样将窗体一显示就在屏幕中间

passer-by zwj 2003-05-07 06:31:13
我想让窗体一开始就显示在屏幕中间,有没有一个函数能实现,如果改了分辨率也一样的定位在屏幕中间?请大家帮帮忙!!!
...全文
65 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lkyuan 2003-05-08
  • 打赏
  • 举报
回复
8.0版本以前版本怎么了??稳定
zhoufenghubei 2003-05-08
  • 打赏
  • 举报
回复
在窗口的open事件中加上th820901中的代码即可!
xjunhua 2003-05-07
  • 打赏
  • 举报
回复
哎呀,还在用 8。0以前的版本,真是
th820901 2003-05-07
  • 打赏
  • 举报
回复
Environment env_system
Integer int_scrwidth,int_scrheight

//关闭窗口刷新
SetRedraw(False)
//获得屏幕的宽度和高度
GetEnvironment(env_system)
int_scrwidth=PixelsToUnits(env_system.screenwidth,xpixelstounits!)
int_scrheight=PixelsToUnits(env_system.screenheight,ypixelstounits!)
//移动窗口到屏幕中心
move((int_scrwidth - this.width)/2,(int_scrheight - this.height)/2)
//打开窗口刷新
SetRedraw(True)

jet_u 2003-05-07
  • 打赏
  • 举报
回复
Environment envir
Integer li_ReturnCode

// Turn redraw off
win.SetRedraw(False)

// get window size
li_ReturnCode = GetEnvironment(envir)

// move to center
li_ReturnCode = win.move((PixelsToUnits(envir.ScreenWidth, XPixelsToUnits!) - win.Width)/2 , &
(PixelsToUnits(envir.ScreenHeight, YPixelsToUnits!) - win.Height)/2 )

// Turn redraw on
win.SetRedraw(True)
IF li_ReturnCode = 1 THEN
return true
ELSE
return false
END IF

1,079

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧