怎么让窗口在屏幕居中呀?

jiazhij 2003-09-12 11:09:08
pb窗口没有设置居中的属性,好郁闷
...全文
52 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
csdsjkk 2003-09-12
  • 打赏
  • 举报
回复
窗口有center属性呀
纳米茶 2003-09-12
  • 打赏
  • 举报
回复
pb8以前窗口对象没有center属性,只能用jonea的类似代码进行设置,pb8以后的版本就有center属性,打勾就可以了
trunman 2003-09-12
  • 打赏
  • 举报
回复
给一个函数:
$PBExportHeader$f_center.srf
$PBExportComments$取得窗口居中
global type f_center from function_object
end type

forward prototypes
global subroutine f_center (window a_win)
end prototypes

global subroutine f_center (window a_win);environment l_env
GetEnvironment(l_env)
Move (a_win, &
(PixelsToUnits(l_env.ScreenWidth, XPixelsToUnits!) - a_win.Width) / 2, &
(PixelsToUnits(l_env.ScreenHeight, YPixelsToUnits!) - a_win.Height) / 2)
end subroutine
workhand 2003-09-12
  • 打赏
  • 举报
回复
没有属性吧,在open时取当前环境,窗口大小,手动设置x,y。只能这样吧
Jonea 2003-09-12
  • 打赏
  • 举报
回复
environment env
integer retur

retur = GetEnvironment(env)
IF retur <> 1 THEN RETURN

w_window.x = (PixelsToUnits(env.ScreenWidth, XPixelsToUnits!) - w_window.width) / 2
w_window.y = (PixelsToUnits(env.ScreenHeight, YPixelsToUnits!) - w_window.height) / 2

1,075

社区成员

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

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