任务栏上的非按钮缩略图工具栏 [英] Non-button Thumnail Toolbars on the Taskbar

查看:122
本文介绍了任务栏上的非按钮缩略图工具栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我遇到了一些带有缩略图工具栏按钮(不是按钮)的应用程序.它们只是没有按钮边框的图像.当我插入尼康相机时,Windows本身就是一个实例.它仅将电池状态显示为图标,而不是完整按钮. 此处 [此处. [ ^ ]这有四个按钮,然后是空格,我假设这是我要尝试的操作,但带有一个空白图标.有谁知道如何使用Windows API代码包(或其他任何方式)通过VB.Net完成此操作?

提前致谢! :)
Ethan

So I have run across a few applications that have thumbnail toolbar buttons that aren''t buttons. They are just images without the button border. One instance is in Windows itself when I plug in my Nikon camera. It shows the battery status as just an Icon and not a full button. Here[^] is what it looks like. Another instance of this is here.[^] This has the four buttons and then the space, which I assume is what I am trying to do but with a blank icon. Does anyone know how to accomplish this with VB.Net using the Windows API Code Pack (or any other way for that matter)?

Thanks in advance! :)
Ethan

推荐答案

完成它的几种方法...

您可以使用按钮,但可以将其FlatStyle属性设置为Flat并将BorderWidth属性设置为0.将图像添加到按钮上就可以了.

另一种方法是将TableLayoutPanel停靠在窗体中,然后向其中添加PictureBox控件.将每个PictureBox的Image属性设置为您选择的图像,并为每个事件处理Click事件,就像处理按钮的Click事件一样.

您可以设置TableLayoutPanel的Padding属性以在PictureBox控件及其CellBorder属性之间放置一些空间,以使其外观漂亮.查看 [
A couple of ways to get it done...

You can use a button, but set its FlatStyle property to Flat and BorderWidth property to 0. Add an image to the button and you''re good to go.

Another way is to dock a TableLayoutPanel in the form and add PictureBox controls to it. Set the Image property of each PictureBox to the image of your choice, and handle the Click event for each one the same as handling a button''s Click event.

You can set the Padding property of the TableLayoutPanel to put some space between the PictureBox controls, and its CellBorder property to give it a nice look. Check out this[^] article to see flat buttons used within a TableLayoutPanel in the screen capture image.

You can of course draw images directly onto the client area and handle the MouseMove and MouseDown events, but that''s a bit more involved to code and probably not as fast as the methods described above.

Hope this was helpful.


这篇关于任务栏上的非按钮缩略图工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆