如何模拟一个象窗体一样的控件(标题栏、焦点、拖动、改变大小、关闭等等)[1]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 sor 的 blog

     用过sql server视图设计或access查询设计的都见过这样的控件,控件外形象一个窗体,有边框、标题栏、图标、关闭按钮,可拖动、改变大小等等

     我前一段时间在做一个自定义查询,想把界面做成象sql server的设计视图那样,终于在msdn里面找到了一些资料

msdn的一些url(把msdn的安装路径改成你自己的路径):

mk:@msitstore:d:\program%20files\microsoft%20visual%20studio\msdn\2001jan\1033\winui.chm::/hh/winui/mousinpt_7ik4.htm

mk:@msitstore:d:\program%20files\microsoft%20visual%20studio\msdn\2001jan\1033\winui.chm::/hh/winui/mousinpt_6085.htm

一、添加一个user control,控件结构如下

version 5.00
begin vb.usercontrol tableview
   autoredraw      =   -1  'true
   clientheight    =   4260
   clientleft      =   0
   clienttop       =   0
   clientwidth     =   3855
   editatdesigntime=   -1  'true
   keypreview      =   -1  'true
   scaleheight     =   4260
   scalewidth      =   3855
   begin vb.picturebox pictitle
      backcolor       =   &h80000003&
      borderstyle     =   0  'none
      height          =   315
      left            =   120
      scaleheight     =   315
      scalewidth      =   2715
      tabindex        =   1
      top             =   120
      width           =   2715
      begin vb.image imgclose
         height          =   210
         index           =   1
         left            =   2400
         picture         =   "tableview.ctx":0000
         top             =   0
         width           =   240
      end
      begin vb.image imgtitle
         height          =   180
         left            =   60
         picture         =   "tableview.ctx":02e2
         top             =   60
         width           =   180
      end
      begin vb.image imgclose
         height          =   210
         index           =   0
         left            =   1560
         picture         =   "tableview.ctx":04d4

本文关键:可变大小的控件
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top