locked
Button Flatstyle Win7 vs WinXP vertical alignment RRS feed

  • Question

  • hi,

    i have a problem with flat buttons. win7 and winXP are displaying them differently.

    buton size is Size(55, 21)
    if FlatStyle is set to System, then the text appears correctly
    once i change it to Flat, only winXP displays it correctly.
    win7 is moving the text a bit down truncting the lower part of the text.
    this is a win7 screenshot showing FlatStyle: flat vs system:
    http://img38.imageshack.us/img38/7928/flatvssystemwin7.png

    anyone can help me with this problem ?

    PS:
    changing the size of the buttons is not a desired solution

    thanks
    Tuesday, February 9, 2010 8:43 AM

Answers

  • SOLVED:
    win7 and winXP default font seem to have a different size. winXP ~10.5 and win7 ~11 or 12
    also it was important to set System::Drawing::GraphicsUnit::Pixel

    myitem->Font = gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10.5,
                    System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Pixel)



    thanks
    • Marked as answer by ZTHawk Tuesday, February 9, 2010 5:52 PM
    Tuesday, February 9, 2010 5:52 PM