Auto Row Selection of ListView

How do I automatically highlight the first row in a list view on it being
built?


0
w_gower (280)
9/22/2003 4:56:30 AM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
340 Views

Similar Articles

[PageSpeed] 39

>How do I automatically highlight the first row in a list view on it being
>built?

William,

Have you tried using something like:

list_ctrl.SetItemState( 0, 0,
		LVIS_SELECTED|LVIS_FOCUSED);

Dave
-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl (422)
9/22/2003 6:55:09 AM
Yes but that doesn't work.  I want the first row in the list view to be
automatically highlighted.

"David Lowndes" <davidl@mvps.org> wrote in message
news:967tmvsue34sr937h7vkuecd0i171u073m@4ax.com...
> >How do I automatically highlight the first row in a list view on it being
> >built?
>
> William,
>
> Have you tried using something like:
>
> list_ctrl.SetItemState( 0, 0,
> LVIS_SELECTED|LVIS_FOCUSED);
>
> Dave
> -- 
> MVP VC++ FAQ: http://www.mvps.org/vcfaq


0
w_gower (280)
9/22/2003 3:49:31 PM
>Yes but that doesn't work.  I want the first row in the list view to be
>automatically highlighted.

You're not being very clear about what you want.

Have you given your control the LVS_SHOWSELALWAYS style so that you
can see the selected item when the control doesn't have the focus?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl (422)
9/22/2003 4:19:23 PM
What I would like is that as soon as the list view is displayed, the first
row is automatically highlighted.   I am using ListViewEx so I am getting
full row selection.  I want to have the first row automatically highlighted
and selected.

"David Lowndes" <davidl@mvps.org> wrote in message
news:t48umvcqphvab1tg3fcg2vbhi254so4g2r@4ax.com...
> >Yes but that doesn't work.  I want the first row in the list view to be
> >automatically highlighted.
>
> You're not being very clear about what you want.
>
> Have you given your control the LVS_SHOWSELALWAYS style so that you
> can see the selected item when the control doesn't have the focus?
>
> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq


0
w_gower (280)
9/22/2003 4:52:15 PM
>What I would like is that as soon as the list view is displayed, the first
>row is automatically highlighted.   I am using ListViewEx so I am getting
>full row selection.  I want to have the first row automatically highlighted
>and selected.

In that case, appropriate use of the (corrected) line of code below
should work.

	m_List.SetItemState( 0, LVIS_SELECTED | LVIS_FOCUSED,
		LVIS_SELECTED | LVIS_FOCUSED );

Dave
-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl (422)
9/22/2003 6:23:38 PM
Reply:

Similar Artilces:

Auto Filter problem
I am using the auto filter for a particular column to sort out differen medical programs. When I click the drop down and click a program, i doesnt show me ALL the lines that say this particular program. Why is this? -- Message posted from http://www.ExcelForum.com Hi maybe some hidden characters in these lines 8e.g. additional space characters, etc.) -- Regards Frank Kabel Frankfurt, Germany "jkb724 >" <<jkb724.19rasx@excelforum-nospam.com> schrieb im Newsbeitrag news:jkb724.19rasx@excelforum-nospam.com... > I am using the auto filter for a particular column to so...

Auto-Editing
Word 2003 has a very annoying default. It assumes too much! If I reformat a few words in a document, it changes the entire document to that formatting. Grr-rrr-r! I have to constantly press undo to get what I want. I know there's a feature that's causing this annoyance but I can't find it to turn it off! Can anyone help, please? See http://word.mvps.org/faqs/formatting/wholedocumentreformatted.htm. -- Stefan Blom Microsoft Word MVP "Connie Martin" <ConnieMartin@discussions.microsoft.com> wrote in message news:CD959D82-F81B-4A9D-993E-73...

Auto-Calculate
I have a spreadsheet that utilize the stock quote add-in from MSN. On a daily basis I refresh the add-in functions for the Highs, Lows, Last, Volume, etc. On occasion the spreadsheet reverts to manual caculation settings, and I have to press the F9 even after I updated the quotes. I've always preferred the any spreadsheets I open, blank or otherwise, the automatic setting selected for calculations. I consider this an annoyance. Has anyone experienced this glitch? Is there a fix for it? Ron_D Ron Excel takes the calculation mode from the first workbook that opens in a session. Sub...

Create a button to insert a new row.
I know Excel can do it; I just don't know how. In addition, once the new row is inserted, I need the formulas to carry into it. Any help is greatly appreciated! I can think of many possibilities, but I'm sure you are thinking of something very specific. Please give more information. -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "Sharon" wrote: > I know Excel can do it; I just don't know how. In addition, once the new row > is inserted, I need the formulas to carry into it. > &g...

auto copy self
How do I arrange for Outlook to automatically copy myself on every new, reply or forward email? If you mean keep a copy of all sent, see settings under Tools/Options/Email Options and Advanced Options David "rich" <steamuk@aol.com> wrote in message news:055c01c3664f$dadecd30$a001280a@phx.gbl... > How do I arrange for Outlook to automatically copy myself > on every new, reply or forward email? ...

Auto Scale Chart Macro -- Any improvements please?
This is the best way I've found to correctly scale a chart -- the only way I found to exclude a chart interpolating with #NA cells was to delete those cells containing #NA, and run the chart. This takes a long time on my computer. Wondering if there is a better way. This macro is directly taken from 2 excel mvps and modified; i believe a mehta and ron bovarty, but could be wrong. Thanks for taking a look. Sub AutoScaleYAxes() Dim ValuesArray(), SeriesValues As Variant Dim Ctr As Integer, TotCtr As Integer Application.Run "Extend_Stock_Data" Applic...

Auto correct or Auto complete
We are all familiar witht he auto correct or auto complete functions found in MS applications. Of course that means it is available in Access also. My question is this ... can this function be replicated within the DB, so that the set of auto correct items are part of the package rather than something that would have to be set up on each individual desktop system? It's use, for me, would primarily be within a memo field where medical abreviations, used as a shortcut, would convert to the true meaning as the user types them in. Ex: "prn" without quotes would change to. &qu...

OWA auto login
I am trying to use the credentials from the forms authentication login to automaticaly log in to Outlook Web. I redirect to a URL with this format: http://UserName:Password@mailserver/exchange I have seen this example in other posts but this does not work for me. I still get the Outlook Windows Login prompt. Perry Perecli Manole wrote: > I am trying to use the credentials from the forms authentication > login to automaticaly log in to Outlook Web. I redirect to a URL with > this format: http://UserName:Password@mailserver/exchange > I have seen this example in other posts but t...

Problems with Inserting Rows
Morning Everyone In my previous version of Excel I could click on a row and then "Insert copied cells" anywhere on the sheet (as a new row). My problem is that with this version (2003 professional), when I try and re-insert the row, all the formulas have been converted to values. How do I switch back to inserting the row with formulas Many thanks in advanc Ja Inserting a row seems to work the same in Excel 2003 as in earlier versions, but maybe if you lay out the _precise_ steps to duplicate the problem someone can help you. In particular "re-insert the row" is unc...

macro help = extract content of specific columns accross a row
have a spreadsheet which consists of about 5125 rows and 2840 columns. I am using Excel 2007 in order to get access to the extra columns. Now I need help creating a macro to automate a very tedius and manual task. The first column in the spreadsheet is empty. What I Need =========== For every row I would like to extract the contents of certain columns accross the row and copy to the first column of the row. into the first column i would like to copy the contents of the following columns accross the row. 6C = sixth column, 9C = 9th column etc... 6C + " " + 7C + " &...

Auto look through subfolders
Please help. I can write a macro that will extract data from all excel files in a specific folder. What I need to be able to do is write a macro that will automatically extract data from excel files within folders and sub folders and sub sub folders etc For example the data is all held on the following directory: H:\development forms\2006 cost sheets\ And within that directory by customer - for example Tesco, Boots, Asda etc. These customers are then subdivided into product ranges - eg 1,2,3,4 etc and some futher subdivided by national or exclusive. All the excel files are in exactly th...

Any way to get rid of an auto-suggestion in the login dialog box, for Exchange/OL using RPC over HTTP?
A client was using RPC over HTTP to two different Exchange servers (OL prompting for profile on startup). Both profiles were set up to prompt for credentials upon connection to Exchange. There's now only one Outlook profile needed; the other is gone and OL isn't prompting for the profile selection any longer, which is fine. However, Outlook is remembering domain1\user and domain2\user in the login dialog box, and I'd love to be able to get rid of the no-longer-valid credential dropdown suggestion. (The computer is not a member of a domain and hence always needs to be prom...

Auto date
I am trying to create a field in a form that if anything is changed on it, it will automatically update the date to current date. Is this possible? Sojaminc wrote: >I am trying to create a field in a form that if anything is changed on it, it >will automatically update the date to current date. Is this possible? Make sure the last changed date/time field is in the form's record source table/query. Then use the form's BeforeUpdate event: Me.lastchanged = Now -- Marsh MVP [MS Access] Hi - You can do this in the On Dirty event of the form, which fires as soon as you m...

Select Case Syntax
Greetings, I am trying to use a select case statement where the case is every 7th number. In a For/Next loop it would be written: For i = 14 to 42 step 7 ... Next i How would you do that for Select Case? Anyone help will be appreciated. -Minitman Dim d As Double d = num / 7 If Int(num / 7) <> d Then d = -1 Select Case d Case 2: Case 3 etc, to Case 6 Case -1: ' not a multiple of 7 Case Else: ' some other multiple of 7 End Select Regards, Peter T "Minitman" <steve@minitmaidsofaustin.com> wrote in message ne...

An auto reply to an auto reply!
Had the funniest situation yesterday. Somebody emailed a public folder we have set up. On there we have a rule to send a reply saying thanks for your email -someone will be with you shortly (we have to have this message on - it is for some website that recently went live). Now that auto reply went back to the guy who emailed - who must have sent it from a public folder himself (as he forwarded the original email from a public folder). The guy received our auto reply - and promptly his email system sent an auto reply to us. As is the way it is set up - our email system sent him an auto ...

Date selection criteria expression help needed
i have a database with dates listed as the general date (date and time). some of the cells have null (empty) values. I would like to query for null values and today's date expressed as a long date (mm/dd/yyyy). I am having trouble. any help would be greatly appreciated. Field: YourDateField Criteria: Is Null Or = Date() OR Field: YourDateField Criteria (Line1): Is Null Criteria (Line2): = Date() '==================================================== John Spencer Access MVP 2002-2005, 2007-2008 Center for Health Program Development and Management University of Maryland B...

Auto-Alphabetize
I have a master data sheet, with columns of different information. I'd like to pull information from 3 different columns (Rank,LastName,Shift) into a separate column (I know how to do this). What I would then like to have happen is, in another separate column, have the information sorted alphabetically by last name. There are duplicate last names, in which case I'd like them sorted in rank order. Is this at all possible? Also, I can't use a VB Macro - it needs to be in a formula or array format. Rank.......LastName.........Shift PO Smith B/1 ...

How do I auto-reply incoming eMails ?
During my holidays I want to inform the sender of incoming eMails that I am currently not in office. How can I setup an auto-reply note? Do I setup this in my Outlook 2003 or in the Exchange Server? Joe If you connect to an Exchange server at work, use the Out of Office function (under tools). It will reply once to each sender that you are out of the office. By default in Exchange, auto-replies to the internet are turned off so only internal addresses would receive the Out of Office reply but verify with your Exchange Admin how they have the server configured. If you have a POP3 acc...

Value List needs updating with 600 rows
Hi , I am attempting to get a list of 600 values added into a Value List without having to type them in...I have added them into the MSP_ATTRIBUTE_STRINGS table in a MS ACCESS copy of the project file however when I open the plan back up again in Project, the look up value list has not been refreshed..any ideas?? In Project 2007 you can cut and paste into the lookup table list from excel. That should be easier and safer than mucking around in Access. Isn't 600 values a lot to choose from? The users will have to scroll a lot. -Jack "Steve" <Steve@discussions....

Auto change of Row number within Formulas
Good morning , I would much appreciate some help in creating a formula which would do the following Cell Resul A1 B1 1 A simple formula would be - sum(c(a1):c(b1)), where the result in this case would be the sum of cells c5:c10. Many thanks, Gle Hi Glen, Look at the INDIRECT() function in HELP -- Kind Regards, Niek Otten Microsoft MVP - Excel "millarg" <anonymous@discussions.microsoft.com> wrote in message news:02302493-2C51-4CB9-9463-06523884BBD6@microsoft.com... > Good morning , I would much appreciate some help in creating a formula which would do ...

Auto-Capitalize
How do I turn this off. I'm making a basic flowchart. I need to turn this off. Thank You On Tue, 24 Feb 2009 10:42:05 -0800, eyewirejets <eyewirejets@discussions.microsoft.com> wrote: >How do I turn this off. I'm making a basic flowchart. >I need to turn this off. menu Tools -> Auto Correct Options -- Regards, Paul Herber, Sandrila Ltd. Electronics Packages for Visio http://www.electronics-packages.sandrila.co.uk/ ...

Macro for Deleting rows with balnk cell
Hi, i have several data in a sheet with data in 10 columns... in column A there are cells where it is blank and i want to delete the rows where there is blank cell in column A.. I need the vba macro for this regards, radha Try Sub DeleteBlankRows_2() 'This macro delete all rows with a blank cell in column A 'If there are no blanks or there are too many areas you see a MsgBox Dim CCount As Long On Error Resume Next With Columns("A") ' You can also use a range like this Range("A1:A8000") CCount = .SpecialCells(xlCell...

Rows in Money 2003
The rows, especially in Budget, seem to be overlapped. The top portion of the letter are visible, but the row below covers the lower portion of the above row. Any corrective ideas? ;-) I'm not exactly sure what you are seeing, but it sounds like it could be a display driver issue, so I'd recommend obtaining the latest one, or, if the one you have is the latest one, dropping down the hardware acceleration a bit. Or perhaps the font size (Large fonts?) in windows. -- Glyn Simpson, Microsoft MVP - Money Check http://support.microsoft.com/default.aspx?scid=fh;EN-GB;mny for UK tip...

set row height upon opening excel
I would like to have the row height set to "20" upon opening or creating a new workbook. You can change the default setting for the column, why not for the height of a row. If there is a way to write a macro that will execute when that workbook is open I would be interested in that also. Thanks If you go to your Personal.xls, and paste this code in the "ThisWorkbook" page, it will automatically set the row height to 20. You may need to add this to the new sheet activate as well. Private Sub Workbook_Open() Cells.Select Selection.RowHeight = 20 End Sub &qu...

auto delete attachment
How I can write a rule or script that will automatically delete any email that has the attatchment name? I'm using windows xp and outlook 2003. Norton AntiVirus Deleted1.txt Thanks, Aaron Rules don't touch attachment names so your only other choice is writing a program to do this. Try posting in an Outlook programming forum - also see http://www.slipstick.com and http://www.outlookcode.com for some assistance. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. After searching google.groups.com and finding no answer: Aaron <kuy...