# How can I get a horizontally centered input window?

This example displays a input window at a position of 675 from the left.

winMargins = {{675, Automatic}, {130, Automatic}};
InputString["testing WindowMargins!  stop: 0",
FieldSize -> Small, WindowMargins -> winMargins];


I want to display the window centered horizontally on the screen. I tried to use the following, but it does not work.

winMargins = {{Scaled[{0.5}], Automatic}, {130, Automatic}};


How can I get a horizontally centered input window?

-

## 1 Answer

In Version 7 on Windows 7 this configuration appears to produce a horizontally centered window:

winMargins = {{Automatic, Automatic}, {130, Automatic}};

-
Works in v8, v9 (Mac) too. – Michael E2 Jul 26 '13 at 12:24