zoukankan      html  css  js  c++  java
  • WPF窗体设计不符合微软自己的UX Guide

    冲突的地方就在于窗体应该不应该有左上角的图标?不知大家平时有没有注意这个问题?

    这个谁说都没有用,看看微软的已经有的软件,主窗体都有,从主窗体弹出的绝大多数子窗体都没有。再来看看微软自己的UX Guide上是怎么说的。

    Title bars

    Dialog boxes dont have title bar icons. Title bar icons are used as a visual distinction between primary windows and

    secondary windows.

    m Exception: If a dialog box is used to implement a primary window (such as a utility) and therefore appears on the taskbar, it does have

    a title bar icon. In this case, optimize the title for display on the taskbar by concisely placing the distinguishing information first.

                                                                                                    Page 421 in pdf

    Title bar icons

    Dialog boxes dont have title bar icons.

    m Exception: If a dialog box is used to implement a primary window (such as a utility) and therefore appears on the taskbar, it does have

    a title bar icon.

                                                                                                                                      Page 426 in pdf

    Icons

    Modal error message dialogs dont have title bar icons. Title bar icons are used as a visual distinction between primary windows

    and secondary windows.

                                                                                                             Page 541 in pdf

    程序里的不在任务栏里的弹出框实在是太常见了,而现有的程序和UX Guide都告诉我们这个弹出框上不应该有左上角的Icon。好,知道了,以后这么做就是了。

    等等,WPFWindow不愿意给你这个机会!看看WPF的MSDN上是怎么说的。

    A WPF window always displays an icon. When one is not provided by setting Icon, WPF chooses an icon to display based on the following rules:

    1. Use the assembly icon, if specified.
    2. If the assembly icon is not specified, use the default Microsoft Windows icon.

    得,微软自己两个TEAM打起来了。说直接点就是,WPFWindow没有WinFormForm里的ShowIcon属性。

    当然人不能让尿憋死,办法总是有的。不过要直接调用Win32 API。介绍在这里。我在项目里也试了一下(毕竟UX优先级高些),不是很好用。后来看了看Form里的ShowIcon方法是如何实现的才正确地解决了。要在上面的方法的基础上,SetWindowPos之后,再用下面的代码给Window发两个消息。

    SendMessage(hwnd, 0x80, 0, 0);

    SendMessage(hwnd, 0x80, 1, 0);

    才能把Icon删掉。

  • 相关阅读:
    关于谷歌、火狐 右键没有发送到onenote选项
    织梦CMS后台卡死的解决办法
    关于MS office 180天后再次激活遇到的问题解决方法
    IE浏览器中发送到onenote的选项没有调出来??
    解决apache服务器本地可以访问,同局域网内他人不能访问的问题(转)
    eclipse编辑器,怎么创建PHP和JAVA的工程项目?
    关于在VMware上装lFEDORA系统
    关于win7右下角显示“音频服务未运行”的解决方法
    关于装虚拟机遇到的若干问题
    关于无光盘无u盘状态下该如何安装系统
  • 原文地址:https://www.cnblogs.com/nankezhishi/p/1377366.html
Copyright © 2011-2022 走看看