Board index » cppbuilder » LBS_NOSEL and Owner Drawn TListBox

LBS_NOSEL and Owner Drawn TListBox

I have an ower-drawn TListBox which is read-only, and I want to get rid of
the dotted-line rectangle that appears around the zeroeth item when I fill
the list and it has focus.

Simply setting Enabled to false does the trick, except that the scroll bar
is also disabled if the number of items exceeds visible lines.

I fooled around a bit with the WinAPI GetWindowLong() and SetWindowLong()
functions, but using them (called from the MainForm's constructor or
Create()) simply cause my TListBox not to draw.  Which does solve the first
problem, I guess, but causes this other undesirable behaviour.

Ideas?

 

Re:LBS_NOSEL and Owner Drawn TListBox


Hi Ray

void __fastcall TForm1::ListBox1Enter(TObject *Sender)
{
   Edit1->SetFocus();// or another control

Quote
}

//---------------------------------------------------------------------------

Happy regards
Asger

Re:LBS_NOSEL and Owner Drawn TListBox


A little on the homely side, but I used it!  Thanks.

Quote
"Asger Joergensen" <Asge...@get2net.dk> wrote in message

news:3A2405BA.37D3E207@get2net.dk...
Quote
> Hi Ray

> void __fastcall TForm1::ListBox1Enter(TObject *Sender)
> {
>    Edit1->SetFocus();// or another control
> }

//--------------------------------------------------------------------------
-
Quote

> Happy regards
> Asger

Other Threads