当前位置:首页
开发技术指南» 文章正文
    引言:

 ·mshflexgrid的问题    »显示摘要«
    摘要: 先在第一个窗体用mshflexgrid控件显示报表,再创件一个窗体,叫他又text显示表的一行全部内容,一个text一个内容 我想在mshflexgrid里面双击第一字段的任意一个内容,就能在text里面显示出来,请问怎么写呢? ......
    摘要: 在listview控件已列表显示时,如何改变某一行的小图标,其余行的小图标不变? ......


在线等待,一个界面显示的问题

各位大虾,请问我想实现系统界面能够随着显示的分辨率自动调整按钮的位置,怎么实现  
  能够把详细的代码贴出来吗?

NO.1   作者: wang661

environment   env  
  integer   ii_ScreenWidth,ii_ScreenHeight  
  double   WRadio,HRadio,Radio  
  integer   ii_WinBolderWidth,ii_WinBolderHeight  
  getenvironment(env)  
  ii_WinBolderWidth=this.width   //取得窗体的边框宽度  
  ii_WinBolderHeight=this.height  
  ii_ScreenWidth=env.screenwidth  
  ii_ScreenHeight=env.screenheight  
  //compute   the   radio   that   need   be   resize  
  //  
  WRadio=ii_ScreenWidth/800   //标准认为屏幕分辨率为800*600  
  HRadio=ii_ScreenHeight/600//计算出屏幕相对800*600分辨率的变化量  
   
   
   
  Radio=Min(WRadio,HRadio)  
   
  if   Radio=1.0   then   //if   the   screen   is   default   800*600  
  return   0  
  end   if    
  this.hide()  
  this.width=(this.width   -   ii_WinBolderWidth)*Radio   +   ii_WinBolderWidth  
  this.height=(this.height   -   ii_WinBolderHeight)*Radio   +   ii_WinBolderHeight    
   
  integer   i  
  dragobject   temp//用于取各种控件  
   
  for   i=1   to   upperbound(this.control)  
  temp=this.control[i]//调整大小,位置  
  temp.width=temp.width*Radio  
  temp.x=temp.x*Radio  
  temp.y=temp.y*Radio  
  temp.Height=temp.Height*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!   //   datawindows   get   zoomed  
    datawindow   dw  
    dw   =   temp  
    dw.Object.DataWindow.zoom   =   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  
  this.show()  
   
   
  return   0

NO.2   作者: moonshineidolon

上面的例子类似于放大镜,有的控件不好用,你还是最好做个模板窗口,在窗口的resize的事件中写语句,让你的界面上的控件根据最外面的窗口的大小在变化,比如按钮的位置是距离右上角的相对值,确定下来这个以后,和他相邻的控件以他为基准在相应的变化。


    摘要: c++ 语言标准关于这个问题的阐述非常清楚:当通过基类的指针去删除派生类的对象,而基类又没有虚析构函数时,结果将是不可确定的。这意味着编译器生成的代码将会做任何它喜欢的事:重新格式化你的硬盘,给你的老板发电子邮件,把你的程序源代码传真给你的对手,无论什么事都可能发生。(实际运行时经常发生的是,派生类的析构函数永远不会被调用。 ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE