当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: 怎样实现可扩展/收缩的对话框 在软件的界面设计上,简洁、高效永远是追求的目标。
 

 

 ·如何给工具栏添加背景    »显示摘要«
    摘要: èçºî¸ø¹¤¾ßà¸ìí¼ó±³¾° £ £ ±¾îä½ééü&eg......
 ·(译)win32asm实例-6    »显示摘要«
    摘要: 6.0 - the tiles window图块窗口 we will now create a static control which we will draw the tiles on. 我们将创建一个静态控件。在它上面我们将要画图块。 6.1 - creating the control创建控件 we make a new procedure called initcontro......


怎样实现可扩展/收缩的对话框
怎样实现可扩展/收缩的对话框

 【程序编程相关:关于构造失败如何处理

在软件的界面设计上,简洁.高效永远是追求的目标.可扩展/收缩的对话框能有效的利用屏幕空间资源,展开后能提供较多的设置选项,收拢后又能节省屏幕空间资源,免除一些次要选项对操作的干扰.下面介绍实现原理与细节.图示分别为收拢后与展开后的界面,例子 【推荐阅读:关于成员和基类的构造函数

设计对话框时是完整的(也就是展开后)大小,当对话框初始化时我们只显示一部分,也就是收拢后的效果.只显示一部分对话框界面的功能可以通过函数 setwindowpos 来实现.下面是它的原型: 【扩展信息:一个“tif was not decla

原理

bool setwindowpos(

hwnd hwnd, // handle of window

hwnd hwndinsertafter, // placement-order handle

int x, // horizontal position

int y, // vertical position

int cx, // width

int cy, // height

uint uflags // window-positioning flags

);

cx 就是窗口重新设置的宽度.

cy 就是窗口重新设置的高度.

我们这样来调用它:

invoke setwindowpos, hwnd, null, 0, 0, ebx, eax, swp_nozorder or swp_nomove

其中 ebx 与 eax 就是新的窗口宽度与高度.

初始化对话框大小后,在程序中我们还要能响应按钮消息展开/收拢对话框.所以我们把设置窗口大小的代码编写成一个函数,在需要的时候就可以调用.具体实现代码如下:

例子

.386

.model flat,stdcall

option casemap:none

;****************************************************************************************

include c:\masm32\include\windows.inc

include c:\masm32\include\user32.inc

include c:\masm32\include\kernel32.inc

includelib c:\masm32\lib\user32.lib

includelib c:\masm32\lib\kernel32.lib

;****************************************************************************************


...   下一页
 ·(译)win32asm实例-4    »显示摘要«
    摘要: 4.0 - creating the main frame创建主框架 now we will create the main frame of our program: 现在我们将创建我们程序的主框架: add two prototypes after the includes: 在include后加入两个原型 winmain proto stdcall :dword, :dw......
» 本期热门文章:

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