Alt-Tab 对话框中显示我的应用程序的通用图标
我有一个旧的 VB6 应用程序,每当用户执行 Alt-Tab 操作时,对话框都会显示通用图标而不是应用程序图标。
如何在 Alt-Tab 窗口中显示正确的图标?
I have an old VB6 app and whenever the user does the Alt-Tab thing, the dialog displays a generic icon instead of the application icon.
What can I do to display the proper icon in the Alt-Tab window?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
每个表单都有一个“图标”属性,您可以在属性窗口中设置以分配图标。听起来这是用来在主窗体上设置图标的,因此您的应用程序的窗口看起来是正确的。
但是,还有一个用于 Alt-Tab 窗口和任务栏的项目级图标。您可以在“项目/属性”对话框的“制作”选项卡上进行设置:
在“应用程序”部分中,您可以设置应用程序的标题,并使用下拉列表将应用程序的表单图标之一指定为应用程序图标。这就是 Alt-Tab 对话框和任务栏中将显示的内容。
请注意,每个表单还有一个默认为 True 的“ShowInTaskbar”属性。对于应用程序中的任何非模式表单(主表单除外),您应该将此属性设置为 False,以防止它们显示其他任务栏图标。
最后,您应该检查 Adam Dempsey 的答案上的链接,了解如何支持多个图标分辨率。至少,您可以创建一个 16x16 图标并按照说明附加它。 Windows 将处理缩放,但当您的图标放大到更高的分辨率时,您会得到一些模糊。
Each form has an "Icon" property you can set in the properties window to assign an icon. It sounds like this was used to set the icon on the main form, so your app's window looks correct.
However, there is also a project-level icon that is used for the Alt-Tab window and the taskbar. You set this on the "Make" tab of the "Project/Properties" dialog:
In the "Application" section, you can set the application's title, and use the dropdown list to assign one of the application's form icons to be the application icon. This is what will display in the Alt-Tab dialog and the taskbar.
Note that each form also has a "ShowInTaskbar" property that defaults to True. You should set this property to False for any non-modal forms in your app (other than the main form) to prevent them from displaying additional taskbar icons.
Finally, you should check the link on Adam Dempsey's answer to see how to support multiple icon resolutions. At the bare minimum, you can just create a 16x16 icon and attach it as described. Windows will handle the scaling, although you'll get some blurring when your icon is scaled up for higher resolutions.
除了将图标添加到表单之外,它还需要一些额外的工作,但很容易做到:
http://www.vbaccelerator.com/home/vb/tips/setting_the_app_icon_ Correctly/article.asp
It needs a bit of additional work than just adding the icon to a form, but easy enough to do:
http://www.vbaccelerator.com/home/vb/tips/setting_the_app_icon_correctly/article.asp
尽管今年已经过去了 - 我遇到了问题并解决了它,并且解决方案未在此处显示。由于这是 Google 的热门回复之一,我想我应该将其添加到此处。
如果您已在表单和设置中设置了图标,但它仍然没有显示 - 您可能已将“ShowIcon”表单设置设置为 false。当此值为 false 时,即使您附加了图标 - 它也不会显示在 Alt-Tab 菜单中。
though this years old - I had the problem and solved it, and the solution isn't shown here. Since this in one of the top Google responses, i thought i'd add it here.
If you have set the icon on the form and in the settings, and it still isn't showing - you may have set the "ShowIcon" form setting to false. When this is false, even if you have an icon attached - it won't show in the Alt-Tab menu.