⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 怎样根据不同电脑分辩率自动调整.txt

📁 源码可以下载 PB方面的 主要是PB的数据库管理方面的 技术资料 可以让大家学习的
💻 TXT
字号:
網上下的,參考一下~~~~~

将以下复制到写字板。然后以srf扩展名保存。导入pbl 
$PBExportHeader$f_windowscreen.srf
$PBExportComments$根据不同分辨率改变窗口和控件大小,以及字体大小。参数:窗口名,开发环境分辨率。如:f_windowscreen(this,1024,768)
global type f_windowscreen from function_object
end type
forward prototypes
global function integer f_windowscreen (readonly window arwin, integer arx, integer ary)
end prototypes
global function integer f_windowscreen (readonly window arwin, integer arx, integer ary);environment env
int ii_Screenwidth,ii_Screenheight
double WRadio,HRadio,Radio
int ii_WinBolderwidth,ii_WinBolderheight
getenvironment(env)
ii_WinBolderwidth=arwin.width - arwin.workspacewidth()//取得窗体边框的宽度
ii_WinBolderheight=arwin.height - arwin.workspaceheight()
ii_Screenwidth=env.screenwidth
ii_Screenheight=env.screenheight
//************************************************************************//
//获取需要调整的计算机分辨率**********************************************//
WRadio=ii_Screenwidth/arx //标准认为屏幕分辨率为arx*ary
HRadio=ii_Screenheight/ary//计算出屏幕相对arx*ary分辨率的变化
Radio=min(WRadio,HRadio)
if Radio=1.0 then //如果分辨率是arx*ary
return 0
end if
if (arwin.WindowType=MDIHelp!) or (arwin.WindowType=MDI!) then 
 arwin.resize(arwin.workspacewidth()*Radio,arwin.workspaceheight()*Radio)
 return 0
else
arwin.hide()
arwin.width=(arwin.width - ii_WinBolderwidth)*Radio + ii_WinBolderwidth
arwin.height=(arwin.height - ii_WinBolderheight)*Radio + ii_WinBolderheight
int i
dragobject temp//用于取各种控件
windowobject song[]
song[]=arwin.control[]
for i=1 to upperbound(song)
 temp=arwin.control[i]//调整控件大小和位置
 temp.width=temp.width*Radio
 temp.x=temp.x*Radio
 temp.height=temp.height*Radio
 temp.y=temp.y*Radio
 choose case typeof(temp)
  case tab!
   tab mtab
   mtab=temp
   mtab.textsize=mtab.textsize*Radio//设置字体大小
  case commandbutton!
   commandbutton cb
   cb=temp
   cb.textsize=cb.textsize*Radio
  case singlelineedit!
   singlelineedit sle
   sle=temp
   sle.textsize=sle.textsize*Radio
  case editmask!
   editmask em 
   em=temp
   em.textsize=em.textsize*Radio
  case statictext!
   statictext st
   st=temp
   st.textsize=st.textsize*Radio
  case datawindow!//get datawindow zoomen
   datawindow dw
   dw=temp
   dw.object.datawindow.zoon=string(int(Radio*100))//注意datawindow和其他控件的不同。
  case picturebutton!
   picturebutton pb
   pb=temp
   pb.textsize=pb.textsize*Radio
  case checkbox!
   checkbox cbx
   cbx=temp
   cbx.textsize=cbx.textsize*Radio
  case dropdownlistbox!
   dropdownlistbox ddlb
   ddlb=temp
   ddlb.textsize=ddlb.textsize*Radio
  case groupbox!
   groupbox gb
   gb=temp
   gb.textsize=gb.textsize*Radio
  case listbox!
   listbox lb
   lb=temp
   lb.textsize=lb.textsize*Radio
  case multilineedit!
   multilineedit mle
   mle=temp
   mle.textsize=mle.textsize*Radio
  case radiobutton!
   radiobutton rb
   rb=temp
   rb.textsize=rb.textsize*Radio
 end choose
next
arwin.show()
return 0
end if
end function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -