开发者

Calculating toolbar icon width

开发者 https://www.devze.com 2023-01-03 12:23 出处:网络
I am building an RDP client and I have toolbar that shows the running applications, same as the Windows toolbar.I need to support dual monitors, so my questions are 1) How do I detect that there is mo

I am building an RDP client and I have toolbar that shows the running applications, same as the Windows toolbar. I need to support dual monitors, so my questions are 1) How do I detect that there is more tha开发者_如何学运维n one monitor and 2) Is there a formula for calculating the width of the icons on the toolbar?

I know that at the start, the width is not dependent on the number of monitors, and is always the same size. What does change is the number of icons I can display before I must start "shrinking" their width, and it will depend on the screen resolution as well.

Any ideas?


Answering 1) - There is the EnumDisplayMonitors function. Now regarding 2) - What do you mean with "like the windows toolbar"? If you mean something similar to the taskbar then I guess it mainly depends on what icon sizes you want to use. All the standard application icons usually supply icon sizes of 16x16, 24x24, 32x32, 48x48 and so on. There's no universal formula - you know how much width you have available, and then you decide on which icon size to use. But keep in mind that you eventually will run out of space no matter how small the icon, so perhaps you should think of adding some sort of scroll button. Hope that helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消