I'd like to remove the selection highlight for a listbox when the control loses focus, and switch it back on when focus returns. I've tried lots of different ways with little success. The following code works for switching the selection off, but doesn't work for switching it back on.
The problem seems to be that something resets EDisableHighlight after I've unset it.
Try This code it will Works for both Cases
void Container::FocusChanged(CAknColumnListBox* aListBox)
{
if(aListBox){
TInt flags(aListBox->ItemDrawer()->Flags());
flags |= CListItemDrawer::EDisableHighlight;
if(aListBox->IsFocused()){
aListBox->ItemDrawer()->ClearFlags(flags);
}
else{
aListBox->ItemDrawer()->SetFlags(flags);
}
aListBox->DrawNow();
}
}