List control selction and deselection

For selecting an item from a CListCtrl just call

mList.SetItemState(iItem,LVIS_SELECTED | LVIS_FOCUSED,   0xFF)
during Initialization


For deslecting we need to insert item once again, ie

mList.DeleteAllItems()
mList.InsertItem()

i know this is not a good method, but i didnt get any other options.
if anyone know, pls let me know!!!

Regards



0
1/16/2008 3:47:51 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
497 Views

Similar Articles

[PageSpeed] 35

"johnWins" <johnsvakel@gmail.com> wrote in message 
news:2ccf2c5c-eb5c-46fd-9bd5-30d89d2048f6@v67g2000hse.googlegroups.com...
> For selecting an item from a CListCtrl just call
>
> mList.SetItemState(iItem,LVIS_SELECTED | LVIS_FOCUSED,   0xFF)
> during Initialization
>
>
> For deslecting we need to insert item once again, ie
>
> mList.DeleteAllItems()
> mList.InsertItem()
>
> i know this is not a good method, but i didnt get any other options.
> if anyone know, pls let me know!!!
>
> Regards
>
>
>

Here's how I clear selection from all items:

 // Remove selections
 POSITION pos = GetFirstSelectedItemPosition();
 while (pos)
 {
  int iItem = GetNextSelectedItem(pos);
     SetItemState (iItem, 0, LVIS_SELECTED);
 }


-- David 


0
dc2983 (3206)
1/16/2008 4:59:03 AM
I use the same technique.
			joe

On Tue, 15 Jan 2008 20:59:03 -0800, "David Ching" <dc@remove-this.dcsoft.com> wrote:

>"johnWins" <johnsvakel@gmail.com> wrote in message 
>news:2ccf2c5c-eb5c-46fd-9bd5-30d89d2048f6@v67g2000hse.googlegroups.com...
>> For selecting an item from a CListCtrl just call
>>
>> mList.SetItemState(iItem,LVIS_SELECTED | LVIS_FOCUSED,   0xFF)
>> during Initialization
>>
>>
>> For deslecting we need to insert item once again, ie
>>
>> mList.DeleteAllItems()
>> mList.InsertItem()
>>
>> i know this is not a good method, but i didnt get any other options.
>> if anyone know, pls let me know!!!
>>
>> Regards
>>
>>
>>
>
>Here's how I clear selection from all items:
>
> // Remove selections
> POSITION pos = GetFirstSelectedItemPosition();
> while (pos)
> {
>  int iItem = GetNextSelectedItem(pos);
>     SetItemState (iItem, 0, LVIS_SELECTED);
> }
>
>
>-- David 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
1/23/2008 4:54:49 AM
Reply:

Similar Artilces:

Excel Drop Down lists
I've created a spreadsheet with a drop down list, however, i want the user to be able to select an from a list of options, which would then poplulate the cell with an associated code If they selected "slate" from the list below, the information put into the cell would be SL, any idea or advice on how i do this? Kindest regards Marta Slate SL Begin by selecting that cell and choosing Data Validation again and go to the [Error Alert] tab and clear the checkbox that says to show an error message when an entry not in th...

how to restrict domain user to view or list all public folders
Tried open public folder store to change the security to restrit the specific user but fail. Open ESM find your want to restrict public folder properties\permission tab click client permission set default right to NONE "DK" <DK@discussions.microsoft.com> wrote in message news:61C9A8E7-02B7-457D-8DF2-3A36A2F1AEF4@microsoft.com... > Tried open public folder store to change the security to restrit the > specific > user but fail. ...

Adjust the width of a tab control on a form?
Hi In my database, there is a main form and a subform. The subform consists of a tab control. In this tab control, I have placed my forms (which have working Master and Child links). I can't seem to make the tab control narrower than its current size. I want to make 8 inches wide instead of its current 10 inches. None of the forms in the tab control are 10 inches wide. How can I make this change? Thank you in advance for your help. On Mon, 8 Mar 2010 20:04:01 -0800, forest8 <forest8@discussions.microsoft.com> wrote: >Hi > >In my database, t...

Money 2004
I'm trying to set up Money 2004 on my wife's brand new Dell - it came as an OEM package, brand new, never been used. I was able to enter both of our checking and savings accounts. When I selected the financial institution, I was able to draw from a long list of registered institutions. I set up all 4 accounts, no problem. Then I tried to enter a credit card account, but the drop-down financial institutions list was empty except for the one bank I had already used. How do I get the rest of the list back? -Rich In microsoft.public.money, Richard Ogden wrote: >I'm trying to se...

How do I create/filter a list of names without duplications
I have a list of names some of which appear more than once. How do I create/filter this column to produce a list of names without duplications? Click on the first name in the list. Then go to "Data", then "Filter", then "Auto Filter". "MikeD" wrote: > I have a list of names some of which appear more than once. How do I > create/filter this column to produce a list of names without duplications? Mike Select your range then Data>Filter>Advanced Filter. "Unique records only" and "Copy to a new location" if don't...

Auto update contact e-mails to address book distribution lists
I'm uploading about 2000 contacts adn mapping information to various fields. Can I change the way I view my ADDRESS book. I have been trying to change it so shows company (Last,First). I'm starting with a blank address book, changing the settings in tools/options and contacts before i import but it won't apply the changes... can anyone help? Importing with Outlook's Import Wizard is the worst way to create Contacts. The settings you specify for derived fields like "File As," "Full Name," and "Email Display As" will not be appli...

How to synch personal contacts w/ a contacts list in a public fold
Several Outlook 2003 users with Blackberries want to 1) easily copy the contacts from several public contacts folders into their own personal contacts and 2) be able to receive changes when the public folder contact lists are updated by one person. What is the easiest way to do this? Is there any way to "synch" the contacts in the public folder to these users' personal contacts without their intervention? -- Lisa M Not easy but check these options: http://www.slipstick.com/outlook/sync.htm Also, you may want to check with the folks in microsoft.public.pocketpc.actives...

Vista, GetAsynchKeyState(), GetKeyboardState(), Control+Shift?
I have an app that needs to detect whether both the Control and Shift keys are being pressed as it launches so as to enable certain advanced features. I use GetAsynchKeyState() under XP to do this, and it works fine. However, I've just tried doing this under Vista and discovered that it doesn't work. GetAsynchKeyState() returns the expected result if one or the other key is held down, but if both are down, it returns 0 in both cases. I tried substituting GetKeyboardState() instead, but the result is the same. Anyone seen this before? >I have an app that needs to detect wheth...

Distribution List
I have changed my distribution list, saved it and updated it. Nevertheless, when I enter the name of the list, the old members of the list show up. It's as if I had two address books, a new and an old. Any suggestions? Thanks. We can only guess since you failed to tell us how you are selecting this DL as a recipient. I would guess you failed to delete the entry for this DL from your autocompletion cache. -- Russ Valentine "Jethro Pull" <jpull@hotmail.com> wrote in message news:0pLtn.304808$OX4.237082@newsfe25.iad... >I have changed my distribution...

Stock control..help please
Win98 & or Win XP MS-Office...using XL I consider myself an Excel novice student with spreadsheets etc. and have the following problem I wish to seek help with for my son. I have tried to devise a workbook with a stock control system based on a given manufactured item GATES, which there are variants, some years ago but have no records of it now.! E.G. Gate1 is a standard sized item consisting of say 30 different components, and fixed amounts of each of the 30 different components, made up from stock. Gate 2 also a standard size item but of different dimensions from Gate1 above. This pat...

Drop-Down from Data/List box vanished
Using data validation, selecting "list", using "=name" the drop dow list won't appear. The drop-down list was working just fine til started to copy the lines with drop-downs, and now it won't make th drop-downs appear. Other pages in the workbook are displaying drop dow lists just fine. i've tried protection (unlock) and a few othe fruitless attempts. I check the "name" for correct reference an spelling an that is correct Got any Ideas??? thanks, The Fruitless Floundere -- spydo ---------------------------------------------------------------------...

Right click dropdown list in windows explorer?
Don't know what the correct name is for this list, so not really been able to do a sensible search - hope someone can help: When you right click on a file in windows explorer (XP) you get a list of things you can do with this file (open, edit, scan, send to etc etc). Over the years mine list has got long and messy, with things I no longer use, or use very infrequently, so I want to tidy it up and remove some of these "short cuts". For the infrequently used actions I'm happy just to open the application first then open the file from within it. So how can I reconfi...

Controlling XP Pro Upgrades
I've forgotten how this works. Google led me in strange directions. I think there's some starting point on the Start menu, or maybe control panel that allows me to pick the time, and weekday. I hope it allows me to decide whether I want to reboot after the update, or defer it to the next time I do reboot. Comments? In news:hio9as$cim$1@news.eternal-september.org "W. eWatson" <wolftracks@invalid.com> wrote: > I've forgotten how this works. Google led me in strange directions. I > think there's some starting point on the Start menu, or mayb...

Pick List + Alphabetical Skip To or Auto Complete
I have an excel file with a long list of names. We have it set up to do a pick from list but we'd like to allow the user to type a letter and the list will automatically skip to the names that start with that letter. For instance, if they open like list and type "K" it will go to the list of names that begin with K. We are also interested in figuring out how to set up an Auto complete function so that if the user starts typing in the persons name in the cell, the list will narrow to only names that match the string of letters. In other words, if the user starts...

Need to eliminate deleted items from a drop down list
I have a drop down list in one form based on a query from a table. In another form I give the user the ability to delete records from this table, followed by a requery of the drop down list in code. When the user returns to the first form and drops the list down the deleted row still appears as "#deleted". Is there a way to prevent the deleted records from appearing in the list? Bill You should requery the combo box after deleting the records. -- Duane Hookom Microsoft Access MVP If I have helped you, please help me by donating to UCP http://www.access.hookom.net/UCP...

how to get a list of drives present on a hard disk?
i am writing a windows explorer app. i am stuck because i don't know how to get a list of logical drives available on the system. i believe that there got to be a function to to this operation in MFC, but i just couldn't find it. "ari" <tserenda@hotmail.com> wrote in message news:015e01c353d8$e2b0e130$a601280a@phx.gbl... > i am writing a windows explorer app. i am stuck because i > don't know how to get a list of logical drives available > on the system. i believe that there got to be a function > to to this operation in MFC, but i just couldn't ...

ActiveX controls dialog
I have Excel 2003 installed on three computers. On only one I get a the dialog: "This application is about to initialize ActiveX controls that mught be unsafe..." every time I open an excel document. On the other two computers I do not get the dialog. How can I set the one computer so it doesn't show the dialog? Lynn Hi Lynn This link will help. Careful of Word Wrap http://support.microsoft.com/default.aspx?scid=kb;en-us;827742&Product=x l2003 ***** Posted via: http://www.ozgrid.com Excel Templates, Training & Add-ins. Free Excel Forum http://www.ozgrid.com/for...

creat an address list for mail merge
I am trying to creat an address lis for mail merge. Microsoft office publisher this operation cannot be completed because of dialog or data base engine failures please help. Also can not connect to the data source What version of Windows and Publisher are you using!!! Use a Spreadsheet and do a Save As CSV (Comma Separated Values) -- ...

Inventory cONTROL
I am looking for a simple inventory program. I am rebuilding an airplane and need a system for tracking parts and hardware. Anyone have any ideas? CW ...

Controlling Marker Attributes
Is there a way to control the attributes (point size style, color, etc.) of a marker for a scatter chart b setting them programmatically (via Visual Basic o other means) or by setting the values in cells Thanks in advance. VBA is suited to this tedious task. Turn on the macro recorder while you format some markers, and then examine the code. You can put desired values into the worksheet, and have the procedure get the parameters from there. A relevant snippet of code looks like this: With ActiveChart.SeriesCollection(1).Points(2) .MarkerBackgroundColorIndex = 15 ' gray ...

How do I add a numbered list AFTER I typed up my entire document?
I am setting up a restaurant menu in MSWord 07 in this type of format Hamburger......................................$6.00 basic burger cooked to your liking House Salad...................................$7.00 Fresh garden vegetables with your choice of dressing my whole document is setup like that and what i want to do now is add numbers to the actual food item and keep the description directly underneath the food item. If i disable numbered list i can get 1 line of the description to be indented, but the second line doesn't follow suit....any ideas? i already have...

Creating a list from a different worksheet
I would like to create a list in sheet 2 from data in sheet 1 but when I click create list and go to select the range it will not let me click on the tab for sheet 1 to select the required data. Could somebody point me in the right direction please? A list is a feature in xl2003 that allows you to edit that "table" easier. It doesn't allow you to create a separate table in a different worksheet. I like to think of it as an enhanced autofilter range. Maybe you could use the list (or autofilter) on the original sheet and then show the rows you want and copy those ...

Multiple Drop down lists and their combnation
I am trying to create multiple distribution lists in A1 to D1, all these distribution lists have different text in them. Now, my problem is that "Is there any way in excel using which I can get the result of any combination in cell E1"...... For Example: If I have 5 different items in each distribution list from A1-D1, it means that I can have 5X5X5X5=625 possible outcomes. But I know that only certain number of outcomes are useful for me...let's say... 50 among these all are useful and I know what are their respective combintions in cell A1-D1. So, my questi...

How to change marketing member list column
Is there anyway to change marketing members list column? It is not possible to change it via customisation settings at all as the view for it does not exisit. Regards, Kyaw Hi, Can you tell me what you mean by changing Marketing Members list column? If you are talking about changing the type of members of a Marketing List to include types other than Account, Lead or Contact, it cannot be done. Regards, Nithya "Kyaw Zay Ya" wrote: > Is there anyway to change marketing members list column? > > It is not possible to change it via customisation settings at all as t...

Re: Printing list of attendees
IMI Attendees Print - http://www.imibo.com/imidev/Exchange/imiap.htm IMI Attendees Print is small utility specially designed for Microsoft Outlook users to print the names of the people who have been invited to a meeting and response status - Accepted, Declined, Tentative, None. From Outlook, there no direct way to print the response status... This is reason we to produce this unique tools. Key Benefits a.. Obtain information for meeting items from any Appointment folder in Microsoft Exchange Server 5.x or/and Microsoft Exchange Server 2000/2003 b.. Obtain information for Meting Reque...