| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> delphi >> Delphi zhong shi xian ke yi geng gai da xiao de dui hua kuang

Delphi zhong shi xian ke yi geng gai da xiao de dui hua kuang

2007-02-01 20:10:49 编辑來源:互联网 评论
 
 
 
本文为【Delphi中实现可以更改大小的对话框】的拼音翻译版
  guan jian zi :Dialog、 dui hua kuang 、resizable
  1、 wen ti de ti chu
  wen ti lai zi Stanley_Xu, xi wang de dao zhi you guan bi an niu ( huan ke yi you bang zhu ), zuo shang ye mei you cheng xu de tu biao bing qie neng gou geng gai chuang kou da xiao de dui hua kuang 。
  VCL zhong wei TForm she zhi le BorderStyle he BorderIcons shu xing , yong yi jian hua chuang kou yang shi de she zhi ( fou ze jiu yao tiao yong SetWindowLong he GetWindowLong deng API han shu )。TFormBorderStyle he TBorderIcon de ding yi he shuo ming ru xia :
  Value Meaning
  bsDialog Not resizable; standard dialog box border// bu neng gai da xiao
  bsSingle Not resizable; single-line border
  bsNone Not resizable; no visible border line
  bsSizeable Standard resizable border
  bsToolWindow like bsSingle but with a smaller caption
  bsSizeToolWin like bsSizeable with a smaller caption
  type TBorderIcon = (biSystemMenu, biMinimize, biMaximize, biHelp);
  TBorderIcons = set of TBorderIcon;
  Value Meaning
  biSystemMenu The form has a Control menu (also known as a System menu).
  biMinimize The form has a Minimize button
  biMaximize The form has a Maximize button
  biHelp If BorderStyle is bsDialog or biMinimize and biMaximize are excluded, a question mark appears in the form's title bar and when clicked, the cursor changes to crHelp; otherwise,no question mark appears.
  xian ran , tong guo BorderStyle he BorderIcons zhi neng gou man zu yi ban de xu yao , yao shi xian neng gou xiu gai da xiao de dui hua kuang jiu you suo li bu neng ji le 。
  yi ban qing kuang xia , wo yao de dao bu neng zui da zui xiao hua dan you ke yi geng gai da xiao de chuang kou , jiu ba BorderStyle she zhi wei bsSizeable, ba BorderIcons de biMinimize he biMaximize qu diao , jie guo xiang zhe yang : chuang kou ke yi xiu gai da xiao , dan zuo shang jiao you tu biao ,:
Delphi中实现可以更改大小的对话框

  tu 1 dai tu biao de dui hua kuang
  zhu yi zuo shang jiao you tu biao 。
  er wo men de mu biao ze shi xia mian de liang zhong xiao guo , zuo shang jiao dou mei you tu biao , dan chuang kou dou ke yi xiu gai da xiao 。
Delphi中实现可以更改大小的对话框

  tu 2 da kai wen jian dui hua kuang
Delphi中实现可以更改大小的对话框

  tu 3 liu lan wen jian jia dui hua kuang
  2、 wen ti jie jue yi ban
  sou suo le yi xia MSDN, zhao dao yi pian jiao ni ru he she ji ke yi ke geng gai da xiao de shu xing ye de wen zhang ( zai MFC zhong CPRopertySheet shi zuo wei CPropertyPage zi ye chu xian de , hou zhe cong CDialog ji cheng er lai , tong chang bu neng xiu gai da xiao )《How To Design a Resizable MFC Property Sheet》, wen zhong jie shao de fang fa shi zai shu xing ye chuang jian zhi qian xiu gai chuang kou yang shi , ran hou shou dong chu li WM_SIZE xiao xi 。
  int CALLBACK CMyPropertySheet::XmnPropSheetCallback(HWND hWnd, UINT message, LPARAM lParam)
  {
   extern int CALLBACK AfxPropSheetCallback(HWND, UINT message, LPARAM lParam);
   // XMN: Call MFC's callback
   int nRes = AfxPropSheetCallback(hWnd, message, lParam);
   switch (message)
   {
   case PSCB_PRECREATE:
   // Set our own window styles
   ((LPDLGTEMPLATE)lParam)->style |= (DS_3DLOOK | DS_SETFONT
  | WS_THICKFRAME | WS_SYSMENU | WS_POPUP | WS_VISIBLE | WS_CAPTION);
   break;
   }
   return nRes;
  }
  wo shi zhe jiang tong yang de fang fa yong dao VCL de yi ge Form zhong 。 zai she ji shi ba BorderStyle she zhi wei bsDialog, ran hou chong zai CreateParams fang fa 。 dan jie guo shi dui hua kuang que shi bian cheng le hou bian kuang ( yin wei you WS_THICKFRAME yang shi ), shu biao yi dong dao ge ge bian kuang hou neng gou zi dong bian hua , zuo shang jiao ye mei you tu biao , dan chuang kou jiu shi bu neng gai bian da xiao ( tian jia de WM_SIZE xiao xi chu li guo cheng mei you chu fa )。 wen ti chu zai na li ne ?
Delphi中实现可以更改大小的对话框

  tu 4 huan bu neng wan quan ling ren man yi de dui hua kuang
  3、 wen ti de jie jue
  cha le yi fan Forms.pas de yuan dai ma , fa xian le wen ti suo zai 。TCustomForm de WM_NCCREATE xiao xi chu li guo cheng zhong you yi ge ModifySystemMenu qian ru guo cheng , yong lai xiu gai Form de xi tong cai dan 。 zhu yi xia mian hong se wen zi shuo de shi “ shi xi tong cai dan kan qi lai xiang dui hua kuang yi yang ”。 jie xia lai de ji ju dai ma jiu ba xi tong cai dan xiang shan de zhi sheng xia le “ yi dong ” he “ guan bi ”。
  procedure TCustomForm.WMNCCreate(var Message: TWMNCCreate);
  procedure ModifySystemMenu;
  var
   SysMenu: HMENU;
  begin
   ……
   { Modify the system menu to look more like it's s'pose to }
   SysMenu := GetSystemMenu(Handle, False);
   if FBorderStyle = bsDialog then
   begin
   { Make the system menu look like a dialog which has only
   Move and Close }
   DeleteMenu(SysMenu, SC_TASKLIST, MF_BYCOMMAND);
   DeleteMenu(SysMenu, 7, MF_BYPOSITION);
   DeleteMenu(SysMenu, 5, MF_BYPOSITION);
   DeleteMenu(SysMenu, SC_MAXIMIZE, MF_BYCOMMAND);
   DeleteMenu(SysMenu, SC_MINIMIZE, MF_BYCOMMAND);
   DeleteMenu(SysMenu, SC_SIZE, MF_BYCOMMAND);
   DeleteMenu(SysMenu, SC_RESTORE, MF_BYCOMMAND);
   end else
   ……
  end;
  begin
   inherited;
   SetMenu(FMenu);
   if not (csDesigning in ComponentState) then ModifySystemMenu;
  end;
  suo yi , wen ti chu zai you yu “SC_SIZE” bei shan diao , chuang kou de yang shi chu xian le ji xing : you WS_THICKFRAME( ke yi xiu gai chuang kou da xiao ), dan bu xiang ying WM_SIZE xiao xi (SC_SIZE bei shan diao )。
  jie jue de ban fa hen jian dan : shi xian zi ji de WM_NCCREATE xiao xi chu li guo cheng , shou dong xiu gai xi tong cai dan 。
  procedure TZoCDlgResizable.WMNCCreate(var Message: TWMNCCreate);
  //The following codes are copied from Form.pas line 4047, Delphi 7 sp1.
  procedure ModifySystemMenu;
  var
   SysMenu : HMENU;
  begin
   SysMenu := GetSystemMenu(Handle, False);
   { Make the system menu look like a dialog which has only
  Move, Size and Close commands}
   DeleteMenu(SysMenu, SC_TASKLIST, MF_BYCOMMAND);
   DeleteMenu(SysMenu, 7, MF_BYPOSITION);
   //Don't remove the separater before CLOSE command.
  // DeleteMenu(SysMenu, 5, MF_BYPOSITION);
   DeleteMenu(SysMenu, SC_MAXIMIZE, MF_BYCOMMAND);
   DeleteMenu(SysMenu, SC_MINIMIZE, MF_BYCOMMAND);
   { Don't remove the SIZE command, otherwise we'll lose the
  capability of resizing the Dialog. }
  // DeleteMenu(SysMenu, SC_SIZE, MF_BYCOMMAND);
   DeleteMenu(SysMenu, SC_RESTORE, MF_BYCOMMAND);
  end;
  begin
   { Skip TCustomForm's WM_NCCREATE handler, which remove
   the SIZE command from the System Menu.}
   inherited DefaultHandler(Message);
   //Dealing with the System Menu in our own way.
   ModifySystemMenu;
  end;
  4、TZoCDlgResizable lei
  zui zhong de jie jue fang an wo feng zhuang wei yi ge ji cheng zi TForm de lei , xiao guo ru xia , yu tu 1 xiang tong ( ru guo xiang yao tu 2 na yang de xi tong cai dan ze ba tiao yong ModifySystemMenu de xing shan diao ), shi yong de shi hou cong TZoCDlgResizable ji cheng yi ge ji ke 。
  BTW: wo huan shun shou gei TZoCDlgResizable jia le ge SizeGrip shu xing , ju ti qing kuang ke yi kan dai ma 。
Delphi中实现可以更改大小的对话框

  tu 5 mei you tu biao 、 ke yi xiu gai da xiao 、 dai you SizeGrip de dui hua kuang
  xia zai (exe he yuan dai ma )
  http://www.zocsoft.com/temp/Resizable_Dialog.rar
  5、 shen kao zi liao :
  MSDN: How To Design a Resizable MFC Property Sheet
  yin yong di zhi :《Delphi zhong shi xian ke yi geng gai da xiao de dui hua kuang 》【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
guan jian zi :Dialog、 dui hua kuang 、resizable 1、 wen ti de ti chu wen ti lai zi Stanley_Xu, xi wang de dao zhi you guan bi an niu ( huan ke yi you bang zhu ), zuo shang ye mei you cheng xu de tu biao bing qie neng gou geng gai chuang kou da xiao de dui hua kuang 。 VCL zhong wei TForm she zhi le BorderStyle he BorderIcons shu xing , yong yi jian hua chuang kou yang shi de she zhi ( fou ze jiu yao tiao yong SetWindowLong he GetWindowLong deng API han shu )。TFormBorderStyle he TBorderIcon de ding yi he shuo ming ru xia : Value Meaning bsDialog Not resizable; standard dialog box border// bu neng gai da xiao bsSingle Not resizable; single-line border bsNone Not resizable; no visible border line bsSizeable Standard resizable border bsToolWindow like bsSingle but with a smaller caption bsSizeToolWin like bsSizeable with a smaller caption type TBorderIcon = (biSystemMenu, biMinimize, biMaximize, biHelp); TBorderIcons = set of TBorderIcon; Value Meaning biSystemMenu The form has a Control menu (also known as a System menu). biMinimize The form has a Minimize button biMaximize The form has a Maximize button biHelp If BorderStyle is bsDialog or biMinimize and biMaximize are excluded, a question mark appears in the form's title bar and when clicked, the cursor changes to crHelp; otherwise,no question mark appears. xian ran , tong guo BorderStyle he BorderIcons zhi neng gou man zu yi ban de xu yao , yao shi xian neng gou xiu gai da xiao de dui hua kuang jiu you suo li bu neng ji le 。 yi ban qing kuang xia , wo yao de dao bu neng zui da zui xiao hua dan you ke yi geng gai da xiao de chuang kou , jiu ba BorderStyle she zhi wei bsSizeable, ba BorderIcons de biMinimize he biMaximize qu diao , jie guo xiang zhe yang : chuang kou ke yi xiu gai da xiao , dan zuo shang jiao you tu biao ,: [url=http://www.wangchao.net.cn/bbs/pydetail_837874.html][img]http://image.wangchao.net.cn/it/1323636578530.gif[/img][/url] tu 1 dai tu biao de dui hua kuang zhu yi zuo shang jiao you tu biao 。 er wo men de mu biao ze shi xia mian de liang zhong xiao guo , zuo shang jiao dou mei you tu biao , dan chuang kou dou ke yi xiu gai da xiao 。 [url=http://www.wangchao.net.cn/bbs/pydetail_837874.html][img]http://image.wangchao.net.cn/it/1323636593645.gif[/img][/url] tu 2 da kai wen jian dui hua kuang [url=http://www.wangchao.net.cn/bbs/pydetail_837874.html][img]http://image.wangchao.net.cn/it/1323636593756.gif[/img][/url] tu 3 liu lan wen jian jia dui hua kuang 2、 wen ti jie jue yi ban sou suo le yi xia MSDN, zhao dao yi pian jiao ni ru he she ji ke yi ke geng gai da xiao de shu xing ye de wen zhang ( zai MFC zhong CPRopertySheet shi zuo wei CPropertyPage zi ye chu xian de , hou zhe cong CDialog ji cheng er lai , tong chang bu neng xiu gai da xiao )《How To Design a Resizable MFC Property Sheet》, wen zhong jie shao de fang fa shi zai shu xing ye chuang jian zhi qian xiu gai chuang kou yang shi , ran hou shou dong chu li WM_SIZE xiao xi 。 int CALLBACK CMyPropertySheet::XmnPropSheetCallback(HWND hWnd, UINT message, LPARAM lParam) { extern int CALLBACK AfxPropSheetCallback(HWND, UINT message, LPARAM lParam); // XMN: Call MFC's callback int nRes = AfxPropSheetCallback(hWnd, message, lParam); switch (message) { case PSCB_PRECREATE: // Set our own window styles ((LPDLGTEMPLATE)lParam)->style |= (DS_3DLOOK | DS_SETFONT | WS_THICKFRAME | WS_SYSMENU | WS_POPUP | WS_VISIBLE | WS_CAPTION); break; } return nRes; } wo shi zhe jiang tong yang de fang fa yong dao VCL de yi ge Form zhong 。 zai she ji shi ba BorderStyle she zhi wei bsDialog, ran hou chong zai CreateParams fang fa 。 dan jie guo shi dui hua kuang que shi bian cheng le hou bian kuang ( yin wei you WS_THICKFRAME yang shi ), shu biao yi dong dao ge ge bian kuang hou neng gou zi dong bian hua , zuo shang jiao ye mei you tu biao , dan chuang kou jiu shi bu neng gai bian da xiao ( tian jia de WM_SIZE xiao xi chu li guo cheng mei you chu fa )。 wen ti chu zai na li ne ? [url=http://www.wangchao.net.cn/bbs/pydetail_837874.html][img]http://image.wangchao.net.cn/it/1323636593849.gif[/img][/url] tu 4 huan bu neng wan quan ling ren man yi de dui hua kuang 3、 wen ti de jie jue cha le yi fan Forms.pas de yuan dai ma , fa xian le wen ti suo zai 。TCustomForm de WM_NCCREATE xiao xi chu li guo cheng zhong you yi ge ModifySystemMenu qian ru guo cheng , yong lai xiu gai Form de xi tong cai dan 。 zhu yi xia mian hong se wen zi shuo de shi “ shi xi tong cai dan kan qi lai xiang dui hua kuang yi yang ”。 jie xia lai de ji ju dai ma jiu ba xi tong cai dan xiang shan de zhi sheng xia le “ yi dong ” he “ guan bi ”。 procedure TCustomForm.WMNCCreate(var Message: TWMNCCreate); procedure ModifySystemMenu; var SysMenu: HMENU; begin …… { Modify the system menu to look more like it's s'pose to } SysMenu := GetSystemMenu(Handle, False); if FBorderStyle = bsDialog then begin { Make the system menu look like a dialog which has only Move and Close } DeleteMenu(SysMenu, SC_TASKLIST, MF_BYCOMMAND); DeleteMenu(SysMenu, 7, MF_BYPOSITION); DeleteMenu(SysMenu, 5, MF_BYPOSITION); DeleteMenu(SysMenu, SC_MAXIMIZE, MF_BYCOMMAND); DeleteMenu(SysMenu, SC_MINIMIZE, MF_BYCOMMAND); DeleteMenu(SysMenu, SC_SIZE, MF_BYCOMMAND); DeleteMenu(SysMenu, SC_RESTORE, MF_BYCOMMAND); end else …… end; begin inherited; SetMenu(FMenu); if not (csDesigning in ComponentState) then ModifySystemMenu; end; suo yi , wen ti chu zai you yu “SC_SIZE” bei shan diao , chuang kou de yang shi chu xian le ji xing : you WS_THICKFRAME( ke yi xiu gai chuang kou da xiao ), dan bu xiang ying WM_SIZE xiao xi (SC_SIZE bei shan diao )。 jie jue de ban fa hen jian dan : shi xian zi ji de WM_NCCREATE xiao xi chu li guo cheng , shou dong xiu gai xi tong cai dan 。 procedure TZoCDlgResizable.WMNCCreate(var Message: TWMNCCreate); //The following codes are copied from Form.pas line 4047, Delphi 7 sp1. procedure ModifySystemMenu; var SysMenu : HMENU; begin SysMenu := GetSystemMenu(Handle, False); { Make the system menu look like a dialog which has only Move, Size and Close commands} DeleteMenu(SysMenu, SC_TASKLIST, MF_BYCOMMAND); DeleteMenu(SysMenu, 7, MF_BYPOSITION); //Don't remove the separater before CLOSE command. // DeleteMenu(SysMenu, 5, MF_BYPOSITION); DeleteMenu(SysMenu, SC_MAXIMIZE, MF_BYCOMMAND); DeleteMenu(SysMenu, SC_MINIMIZE, MF_BYCOMMAND); { Don't remove the SIZE command, otherwise we'll lose the capability of resizing the Dialog. } // DeleteMenu(SysMenu, SC_SIZE, MF_BYCOMMAND); DeleteMenu(SysMenu, SC_RESTORE, MF_BYCOMMAND); end; begin { Skip TCustomForm's WM_NCCREATE handler, which remove the SIZE command from the System Menu.} inherited DefaultHandler(Message); //Dealing with the System Menu in our own way. ModifySystemMenu; end; 4、TZoCDlgResizable lei zui zhong de jie jue fang an wo feng zhuang wei yi ge ji cheng zi TForm de lei , xiao guo ru xia , yu tu 1 xiang tong ( ru guo xiang yao tu 2 na yang de xi tong cai dan ze ba tiao yong ModifySystemMenu de xing shan diao ), shi yong de shi hou cong TZoCDlgResizable ji cheng yi ge ji ke 。 BTW: wo huan shun shou gei TZoCDlgResizable jia le ge SizeGrip shu xing , ju ti qing kuang ke yi kan dai ma 。 [url=http://www.wangchao.net.cn/bbs/pydetail_837874.html][img]http://image.wangchao.net.cn/it/1323636593970.gif[/img][/url] tu 5 mei you tu biao 、 ke yi xiu gai da xiao 、 dai you SizeGrip de dui hua kuang xia zai (exe he yuan dai ma ) http://www.zocsoft.com/temp/Resizable_Dialog.rar 5、 shen kao zi liao : MSDN: How To Design a Resizable MFC Property Sheet yin yong di zhi :《Delphi zhong shi xian ke yi geng gai da xiao de dui hua kuang 》
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
玉美人_珠联璧合
清纯美女米卡
清新靓丽的早晨
玲子的自信与性感
痞子的甘南日记
疑是银河落九天
雪域坝上四——纯美色
冬日恋歌——西城杨柳弄轻柔
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有