调整窗口位置,使之居中

    技术2022-05-11  104

    在Window的Resize事件中加入:

    //申请系统环境变量environment lenvlong ll_width,ll_height//取得系统环境信息if getenvironment(lenv) = -1 then//   messagebox('错误','获取屏幕信息出错!')else //取得当前屏幕的尺寸,并调整窗口位置,使之居中 ll_height = PixelsToUnits(lenv.screenheight,YPixelsToUnits!) ll_width = PixelsToUnits(lenv.screenwidth,XPixelsToUnits!) this.y = (ll_height - this.height)/2 this.x = (ll_width - this.width)/2end if


    最新回复(0)