任务栏编程

CHUJUN98 2003-11-18 05:17:32
请问:
如何使应用程序在启动时,不显示窗体,而以图标显示在任务栏中。
...全文
39 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
wbwb3448 2003-11-19
  • 打赏
  • 举报
回复
上面漏打了个单词,Form的Visiable属性设为false
wbwb3448 2003-11-19
  • 打赏
  • 举报
回复
哈哈,终于解决问题了,谢谢 glpk() 贴的那段英文,意思是说加在WinMain函数的Application->Run();前面,并把Form的属性设为false,我用trayicon组件加上Application->ShowMainForm = false;解决了这个问题,当然,要在trayicon的OnRestore事件里加入Form1->Visiable=true,不然双击小图标显示不出窗口了~~
yjy1001 2003-11-19
  • 打赏
  • 举报
回复
Application->ShowMainForm = false;到底该放哪里啊~~我实验了N遍了。。根本不行啊。。

放在工程文件中……

解决了?
系统有控件 是容易
Gucai 2003-11-18
  • 打赏
  • 举报
回复
在“工程.Cpp”里加入。
sczyq 2003-11-18
  • 打赏
  • 举报
回复
写在FormCreate里吧.


Application->ShowMainForm = false;
Hide(); // 加上这个
glpk 2003-11-18
  • 打赏
  • 举报
回复
TApplication::ShowMainForm

Determines whether the application shows its main form on startup.

__property bool ShowMainForm = {read=FShowMainForm, write=FShowMainForm, nodefault};

Description

Use ShowMainForm to control whether and when the application shows its main form.

The default value of true is set in the constructor. When ShowMainForm is true the main window shows automatically when the application starts. The MainForm property specifies which form is the main form.

To hide the main form at startup, set ShowMainForm to false in the main project file before the call to Application->Run. Make sure that the Visible property of the form is also false.
wbwb3448 2003-11-18
  • 打赏
  • 举报
回复
Application->ShowMainForm = false;到底该放哪里啊~~我实验了N遍了。。根本不行啊。。
pp616 2003-11-18
  • 打赏
  • 举报
回复
呵呵。
halibut 2003-11-18
  • 打赏
  • 举报
回复
如果要放在系统托盘,要用TTrayIcon
halibut 2003-11-18
  • 打赏
  • 举报
回复
Application->ShowMainForm = false;

13,826

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧