Click here to Skip to main content
15,888,733 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Pull Downs Menu Items Pin
Mark Salsbery11-Nov-08 15:42
Mark Salsbery11-Nov-08 15:42 
AnswerRe: Pull Downs Menu Items Pin
BobInNJ11-Nov-08 13:00
BobInNJ11-Nov-08 13:00 
QuestionGet parent process command line in 64 bit Pin
Jack Rong11-Nov-08 10:23
Jack Rong11-Nov-08 10:23 
QuestionHow to select an initial entry when Virtual List is first displayed? Pin
AmVal11-Nov-08 8:11
AmVal11-Nov-08 8:11 
QuestionRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery11-Nov-08 8:41
Mark Salsbery11-Nov-08 8:41 
AnswerRe: How to select an initial entry when Virtual List is first displayed? Pin
AmVal11-Nov-08 11:25
AmVal11-Nov-08 11:25 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery11-Nov-08 12:39
Mark Salsbery11-Nov-08 12:39 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
AmVal12-Nov-08 4:30
AmVal12-Nov-08 4:30 
From OnInitDialog(), I am calling my BuildList() function to get the data from the database and load into my list. As soon as I finish loading the list, I call SetItemCount(). (I don't know if this ancient version I'm using has SetItemCountEx(). I tried using it, but I got a compile error that 'SetItemCountEx' is not a memeber of CListCtrl).

My SetItemState() to set the ith element to selected looks like this:

MyList_.SetItemState( i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED );

I tried calling it right after calling SetItemCount(), but it doesn't work, even if I give the list control focus.

Speaking of focus, maybe this could be part of the problem. The way my dialog is designed, I have an edit control sitting on top of the list control where the user can start typing in the edit control, and I then highlight/select the nearest match in the list control. So unless they actually click on an item in the list, the focus is in the edit control where they are typing, and I'm trying to select item in the list control. It does work using the simulated mouse click, but another very minor thing is that it looks like with CListCtrl, the highlight is blue if the control has focus, and gray if it doesn't have focus. It would be nice if I could keep the highlight blue all the time, the way CListBox works. So I know even if I can get it to highlight the first item by default, it will only have the gray highlight, not the blue that I would prefer. (That's probabaly not easy to change, huh?)

I originally was just using a CListBox and everything worked great, was simple, had no problem at all. Except the list is so large (~100,000 items) that it was a little slow to load, so I decided to try my hand at a virtual list, which also meant having to change to a CListCtrl, and seems to have introduced a number of minor issues that I've been struggling with.

Does this give you any more idea how I should be handling this? Thank you very much for your help.
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery12-Nov-08 7:29
Mark Salsbery12-Nov-08 7:29 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
AmVal12-Nov-08 10:17
AmVal12-Nov-08 10:17 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery12-Nov-08 10:51
Mark Salsbery12-Nov-08 10:51 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
AmVal12-Nov-08 11:24
AmVal12-Nov-08 11:24 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery12-Nov-08 12:04
Mark Salsbery12-Nov-08 12:04 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
AmVal13-Nov-08 2:51
AmVal13-Nov-08 2:51 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery13-Nov-08 6:25
Mark Salsbery13-Nov-08 6:25 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
AmVal17-Nov-08 4:30
AmVal17-Nov-08 4:30 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery17-Nov-08 4:34
Mark Salsbery17-Nov-08 4:34 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery12-Nov-08 7:35
Mark Salsbery12-Nov-08 7:35 
QuestionException problem Pin
rrrado11-Nov-08 3:44
rrrado11-Nov-08 3:44 
AnswerRe: Exception problem Pin
David Crow11-Nov-08 4:27
David Crow11-Nov-08 4:27 
GeneralRe: Exception problem Pin
rrrado11-Nov-08 4:38
rrrado11-Nov-08 4:38 
GeneralRe: Exception problem Pin
David Crow11-Nov-08 4:55
David Crow11-Nov-08 4:55 
AnswerRe: Exception problem Pin
Rajkumar R12-Nov-08 1:08
Rajkumar R12-Nov-08 1:08 
AnswerRe: Exception problem Pin
Stephen Hewitt11-Nov-08 17:12
Stephen Hewitt11-Nov-08 17:12 
AnswerRe: Exception problem Pin
Randor 11-Nov-08 17:22
professional Randor 11-Nov-08 17:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.