Link to home
Start Free TrialLog in
Avatar of paulburns
paulburns

asked on

initialising sub-classed list control

Where's the best place to modify styles and add columns to a sub-classed list control. i've tried in OnCreate but this dont work. i suppose what i'm after is the equivalent of OnInitialUpdate or OnInitDialog.
Avatar of naveenkohli
naveenkohli

Do it in PreSubclassWindow
e.g. here is sample of my code which i use to subclass a button..

void
CButtonSubc::PreSubclassWindow ()
{
      // Call base class

      CButton::PreSubclassWindow ();

      // Add BS_OWNERDRAW and BS_NOTIFY

      ModifyStyle (0, BS_OWNERDRAW | BS_NOTIFY);

      // Change the window text if necessary

      ChangeWindowText ();
}

Similarly you can change your list control's style and add columns too !

Good Luck!
Avatar of paulburns

ASKER

yep, that its. answer and points are yours. thanks.
ASKER CERTIFIED SOLUTION
Avatar of naveenkohli
naveenkohli

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial