SetTextAlign() help!

This is a discussion on SetTextAlign() help! within the Windows Programming forums, part of the Platform Specific Boards category; ok i read that if you do SetTextAlign(hdc, TA_RIGHT); the text would become right justified....then why doesnt this work...its under ...

  1. #1
    samurai warrior nextus's Avatar
    Join Date
    Nov 2001
    Posts
    196

    SetTextAlign() help!

    ok i read that if you do SetTextAlign(hdc, TA_RIGHT); the text would become right justified....then why doesnt this work...its under WM_PAINT

    Code:
    			SetTextAlign(hdc, TA_RIGHT);
    
    			TextOut(hdc, 0, 0, TEXT("0123456789"), 10);
    and yes i did declare a handle to device context with hdc = BeginPaint(hwnd, &ps);

    ....please explain..and help
    nextus, the samurai warrior

  2. #2
    Registered User SAMSAM's Avatar
    Join Date
    Nov 2001
    Posts
    218
    i think after:

    SetTextAlign(hdc, TA_RIGHT);

    windows will interpret the coordinates in TextOut as the right
    corner of the text string rect. not the top-left corner which
    is the default.



    TextOut(hdc, 0, 0, TEXT("0123456789"), 10);



    *also check your font.is it system font?

  3. #3
    samurai warrior nextus's Avatar
    Join Date
    Nov 2001
    Posts
    196
    still seems left to me...all it did was make it right justified...

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21