cpubbs论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

LabVIEW+单片机学习套件全套教程资料下载[免费]LabVIEW论坛精华列表贴USB0816数据采集卡《LabVIEW宝典》
LabWindows/CVI论坛精华贴NET0816以太网数据采集卡RC0210远程设备授权系统 关闭关停锁定打开设备 户外分布式数据采集
NET1624低速高精度以太网数据采集卡WIFI0824SD无线WIFI网络数据采集卡脱机运行 SD存储 小尺寸微型 串口采集远程采集 安卓 手持移动采集 纪录仪
查看: 823|回复: 5

求助 关于多个面板

[复制链接]
发表于 2010-8-8 02:11:21 | 显示全部楼层 |阅读模式
有一个程序已经写好了。现在我想再加一个面板,在程序开始的时候首先显示我后来添加的面板。在对开机显示面板的控件进行操作过之后,程序才跳到原来程序的主面板上,请问有没有什么好的方法?

拜谢各位了。
发表于 2010-8-8 06:06:38 | 显示全部楼层
面板可以隐藏和显示的,要求最开始不显示的,在主程序那里显示面板的时候不要显示它出来就可以了!
发表于 2010-8-8 06:07:30 | 显示全部楼层
Clears a panel from the screen but leaves it in memory.

After you hide a panel, you can still update it programmatically. For example, you can add plots to a graph control on a hidden panel. When you display the panel again, it shows the new plots. A hidden panel cannot generate events.



Prototype

int HidePanel (int Panel_Handle);
发表于 2010-8-8 06:07:39 | 显示全部楼层
Displays a panel on the screen.

When a panel is visible and not dimmed, the user can operate it and generate events from it. Calling DisplayPanel when a panel is already displayed causes the panel to be completely redrawn.

Example
Refer to the LoadPanel function reference for an example of how to use this and other panel functions.



Prototype

int DisplayPanel (int Panel_Handle);
发表于 2010-8-8 06:07:52 | 显示全部楼层
Loads a panel into memory from a user interface resource (.uir) file or text user interface (.tui) file you created in the User Interface Editor.

The panel becomes a child panel of the parent panel you specify by parentPanelHandle. To make the panel a top-level panel, pass 0 for the parentPanelHandle.

The function returns a panel handle that you use in subsequent function calls to specify the panel. You must call DisplayPanel to make the panel visible.

If you call this function to load a panel as a child panel, you must do so in the same thread in which you create the parent panel.

The ATTR_REPORT_LOAD_FAILURE and ATTR_ALLOW_MISSING_CALLBACKS system attributes affect how this function behaves when it encounters an error. When you run a program in LabWindows/CVI and you enable debugging and the Break on»Library Errors option, a message appears when a LabWindows/CVI function returns an error. In general, this feature is not available when debugging is disabled. However, there is a special system attribute to enable error messages for LoadPanel, LoadPanelEx, LoadMenuBar, and LoadMenuBarEx. By default, the attribute is enabled.

By default, LoadPanel returns an error if LabWindows/CVI cannot find in the project any of the callback functions referenced in the .uir for the panel. If you want to allow a panel to be loaded in this case, enable the ATTR_ALLOW_MISSING_CALLBACKS attribute using the SetSystemAttribute function.

Refer to the list of system attributes for more information.

Note   When you call LoadPanel, each panel and control callback name you specified in your .uir file is automatically linked to the function of the same name. To find callback functions, LabWindows/CVI searches all of the modules linked in your project. If a DLL is linked into your project or dynamically loaded, LabWindows/CVI searches only the symbols exported through the import library.

If you defined callback functions in a DLL but did not export them, LoadPanel cannot find the callback functions. Instead, you must call LoadPanelEx from the DLL.

Example
The following example code demonstrates how to load, display, and then discard a user interface panel. TESTPANEL is the constant name assigned to the panel in the Edit Panel dialog box in the User Interface Editor. panelHandle is the specifier that you use to identify the panel in subsequent User Interface Library function calls.

int main (int argc, char *argv[])

{

int panelHandle;

/* initialize the LabWindows/CVI Run-Time Engine and load the user interface panel into memory */

if (InitCVIRTE (0, argv, 0) == 0)

return -1;

if ((panelHandle = LoadPanel (0, "test.uir", TESTPANEL)) <= 0)

return -1;

/* display the panel and run the UI */

DisplayPanel (panelHandle);

RunUserInterface ();

/* free resources and return */

DiscardPanel (panelHandle);

CloseCVIRTE ();

return 0;

}



Prototype

int LoadPanel (int Parent_Panel_Handle, char Filename[], int Panel_Resource_ID);
发表于 2010-8-8 06:08:04 | 显示全部楼层
就这几个函数就可以实现的!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|cpubbs论坛. ( 粤ICP备09171248号 )

GMT+8, 2025-5-5 13:41 , Processed in 0.686124 second(s), 8 queries , Gzip On, File On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表