News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Radio Buitton Text doesn't show!!!

Started by xandaz, June 24, 2010, 10:21:20 PM

Previous topic - Next topic

xandaz

   Why the hell doesnt the radiobutton's text show? This should be a pretty simple proceeding.

    inv. CreateWindowEx,NULL,addr ButtonClass,addr ButtonText,WS_VISIBLE+WS_CHILD+BS_AUTORADIOBUTTON,\
        NULL,NULL,10,10,hWnd,BtnID,hInstance,NULL
    mov hBtn,eax

    I've tried several things such as WM_SETTEXT, BS_TEXT, BS_RIGHT etc. When i choose the button, the focus rect appears shrunk around text that doesnt appear.
    Can someone help?

MichaelW

#1
The only problem I can see is that the specified width is not enough to contain the text.
eschew obfuscation

Ghandi

I agree, a 10x10 square will only just display the radio button itself, let alone any text.

HR,
Ghandi

hutch--

Yep,

The window size is too small to show much else than the bare radio button circle.

NULL,NULL,10,10

Try something like you initial X-Y co-ordinates then a width of 120 pixels by about 15 pixels high. Check if the text displays correctly and make sure it does not clip off the bottom of characxters like gjpq etc ...
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Tedd

If you're creating controls directly with CreateWindow, you'll need to take dialog-units into account (they're not 1:1 with pixels, or even the same for x or y) -- things require different sizes depending on the selected font; so even when it looks perfect on yours, it could (will) get messed up on another system. This is largely why it's much better/easier to make a dialog template and allow windows to take care of the details.

Anyway, 10x10 should be the size of the 'radio button' (in dialog units) not including the text, 10x150 should allow you enough space for most text (but once again, that's in dialog units.)
No snowflake in an avalanche feels responsible.

xandaz

   Yay! So many replies. Yeah i found that a bit later but thanks anyway.
   Ty guys