Menu

TCheckList defined by resource (myApp.rc)

2024-07-05
2024-07-08
  • Sebastian Ledesma

    Hi:

    Wich it's the correct way to define a TCheckList item defined in a resource file?
    I've created with code like this:
    pCheckList = new TCheckList(this, IDC_DAY, 158, 72, 175, 120, Items, NumItems);

    I'm trying to define using a resource file:
    ` CONTROL "", IDC_DAY, "listbox", LBS_OWNERDRAWVARIABLE | /LBS_OWNERDRAWFIXED | /LBS_DISABLENOSCROLL | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 90, 36, 100, 60

    and in my dialog:
    TDialog::TDialog(...) {
    ...
    pCheckList = new TCheckList(this, IDC_DAY, Items, NumItems);
    ...
    }
    `

    Thanks in advance

     

    Last edit: Sebastian Ledesma 2024-07-05
  • Vidar Hasfjord

    Vidar Hasfjord - 2024-07-08

    Hi Sebastian, defining a TCheckList as a resource using the "listbox" control class should work, provided you include an owner-draw flag, as it seems you've correctly done.

    What problem do you see, if any?

    PS. I've cleaned up the TCheckList example, defining the list as a resource. See [r7079].

     

    Related

    Commit: [r7079]

  • Sebastian Ledesma

    You are right. I don't know why initially I wasnt able to fill the TChecklist by using a .rc control, while the control programatically created worked fine.
    I prefer to use the classic mode (resource) to know wich controls are in a dialog when editing the .RC

     
    👍
    1

Anonymous
Anonymous

Add attachments
Cancel