為什麼現代的GUI往往在消息框的側面都帶有按鈕?


1

消息框以前使按鈕水平居中。例如。這是您在Windows XP上使用MessageBoxW API函數獲得的功能:

Message box on Windows XP

但是,更現代的系統在側面帶有按鈕的消息框,例如在Windows 7上打開的相同消息框:

Message box on Windows 7

Qt3與Qt4 +可以看到相似的結果:

Message box from a Qt3 app

Message box from a Qt4 app

類似的模式適用於帶有多個按鈕的消息框。例如,請參閱以下"是否保存更改?"Windows XP和Windows 7上從記事本中獲得提示:

Three-button message box on Windows XP and 7

由於對稱性,帶有居中按鈕的消息框看起來更好,所以一定有很好的理由進行更改。

此按鈕從居中按鈕變為側面對齊的原因是什麼?側面的按鈕比中間的按鈕有重要的優勢嗎?

1

Ruslan, if you look at older — dare I say, "historical?" ;) — screenshots, you can see that button placement differs considerably between OS platforms.

The Guidebook GUI Gallery website is an awesome resource to compare such details.

I haven't seen any research yet on the impact of left/center/right alignment of buttons in dialogs, but the general rule of striving for consistency applies to button placement as well, of course.

Placing key widgets in the same relative location in every context makes it easier for users to find them, and it reduces error rate. In particular, this applies to the key Cancel/Confirmation button pair.

Both macOS and Windows have defined simple principles on where to place those buttons, and which order they need to be in: you'll typically find those buttons in the botton right corner of a dialog on both OSs. This convention dates back to Mac OS 7 from 1991 and to Window 95/NT4 from 1995/1996. (As seen, e.g., in Open File dialogs or Time and Date Settings.)

So I wonder: have you observed changing button placements for dialogs (or, rather, alerts) that contain more than one button, Ruslan? If not, maybe it was a purely aesthetic consideration for that particular one-button case?