Thread: SetTextAlign() help!

  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