Problems with MFC list controls

    I have a large list control with many inventory control items displayed
within.  When someone single clicks on an item, it displays information
about that item in another part of the dialog.  I have a three-fold problem,
the master list has multiple columns in it, in order to make the selection
work properly, only column 0 can be selected, is there a way to make a valid
row selection if you select an item using any of the other columns?  Second
issue is the highlight of the selection.  Only column 0 in the list control
will highlight, is there a way to make the entire row highlight when any
column in that row is selected?  The third problem I have is everytime the
list control loses focus, the selected item in column 0 loses its
highlighted status.  I would like to keep that row highlighted no matter
what other controls are used on that dialog.  Any thoughts out there?
Thanks in advance for any help.

                    -Dan


0
dcanham (24)
7/27/2003 11:28:53 AM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
1639 Views

Similar Articles

[PageSpeed] 35

"Daniel Canham" <dcanham@rochester.rr.com> wrote in message
news:VHOUa.129758$EQ5.38471@twister.nyroc.rr.com...
>     I have a large list control with many inventory control items
displayed
> within.  When someone single clicks on an item, it displays
information
> about that item in another part of the dialog.  I have a three-fold
problem,
> the master list has multiple columns in it, in order to make the
selection
> work properly, only column 0 can be selected, is there a way to make a
valid
> row selection if you select an item using any of the other columns?
Second
> issue is the highlight of the selection.  Only column 0 in the list
control
> will highlight, is there a way to make the entire row highlight when
any
> column in that row is selected?  The third problem I have is everytime
the
> list control loses focus, the selected item in column 0 loses its
> highlighted status.  I would like to keep that row highlighted no
matter
> what other controls are used on that dialog.  Any thoughts out there?

Possibly the LVS_SHOWSELALWAYS style and the LVS_EX_FULLROWSELECT
extended style.
-- 
Jeff Partch [VC++ MVP]


0
jeffp (1711)
7/27/2003 11:49:33 AM
Ok, I'm feeling a bit stupid now.  LVS_SHOWSELALWAYS works!  Thanks.
However, I could find no reference to a full row select option in the
control properties.  I tried to add it manually to the .rc file and got the
following error

#############
E:\MYPROJECTS\MISC\UpstateApps\UpstateApps.rc (127): error RC2104 :
undefined keyword or key name: LVS_EX_FULLROWSELECT
Error executing rc.exe.
#############

    CONTROL         "List2",IDC_VENDOR_PRODUCT_LIST,"SysListView32",
                    LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS |
                    WS_BORDER | WS_TABSTOP,14,142,185,105

    CONTROL         "List2",IDC_VENDOR_PRODUCT_LIST,"SysListView32",
                    LVS_REPORT | LVS_EX_FULLROWSELECT | LVS_SHOWSELALWAYS |
                    WS_BORDER | WS_TABSTOP,14,142,185,105


That is the control definition in the .rc file.  I added
'LVS_EX_FULLROWSELECT' in place of the 'LVS_SINGLESEL' property, that's when
it kicked out the error.  As you see the control is in 'Report' view, which
all of these require.

//

After looking around I tried this after the control had been initialized.

#############
 m_ctl_vendor_product_list.FullRowSelect(TRUE);

#############

....it didn't like that either

All the other references were to when the control was actually being
contructed.  I couldn't find where that was happening
....any thoughts?



"Jeff Partch" <jeffp@mvps.org> wrote in message
news:efR4kUDVDHA.1316@TK2MSFTNGP12.phx.gbl...
> "Daniel Canham" <dcanham@rochester.rr.com> wrote in message
> news:VHOUa.129758$EQ5.38471@twister.nyroc.rr.com...
> >     I have a large list control with many inventory control items
> displayed
> > within.  When someone single clicks on an item, it displays
> information
> > about that item in another part of the dialog.  I have a three-fold
> problem,
> > the master list has multiple columns in it, in order to make the
> selection
> > work properly, only column 0 can be selected, is there a way to make a
> valid
> > row selection if you select an item using any of the other columns?
> Second
> > issue is the highlight of the selection.  Only column 0 in the list
> control
> > will highlight, is there a way to make the entire row highlight when
> any
> > column in that row is selected?  The third problem I have is everytime
> the
> > list control loses focus, the selected item in column 0 loses its
> > highlighted status.  I would like to keep that row highlighted no
> matter
> > what other controls are used on that dialog.  Any thoughts out there?
>
> Possibly the LVS_SHOWSELALWAYS style and the LVS_EX_FULLROWSELECT
> extended style.
> -- 
> Jeff Partch [VC++ MVP]
>
>


0
dcanham (24)
7/27/2003 6:33:16 PM
TO set an extended listview control style you need to SendMessage it an
LVM_SETEXTENDEDLISTVIEWSTYLE, or see if you can use the
CListCtrl::SetExtendedStyle member function.
-- 
Jeff Partch [VC++ MVP]


"Daniel Canham" <dcanham@rochester.rr.com> wrote in message
news:MVUUa.42441$wk4.40244@twister.nyroc.rr.com...
> Ok, I'm feeling a bit stupid now.  LVS_SHOWSELALWAYS works!  Thanks.
> However, I could find no reference to a full row select option in the
> control properties.  I tried to add it manually to the .rc file and
got the
> following error
>
> #############
> E:\MYPROJECTS\MISC\UpstateApps\UpstateApps.rc (127): error RC2104 :
> undefined keyword or key name: LVS_EX_FULLROWSELECT
> Error executing rc.exe.
> #############
>
>     CONTROL         "List2",IDC_VENDOR_PRODUCT_LIST,"SysListView32",
>                     LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS |
>                     WS_BORDER | WS_TABSTOP,14,142,185,105
>
>     CONTROL         "List2",IDC_VENDOR_PRODUCT_LIST,"SysListView32",
>                     LVS_REPORT | LVS_EX_FULLROWSELECT |
LVS_SHOWSELALWAYS |
>                     WS_BORDER | WS_TABSTOP,14,142,185,105
>
>
> That is the control definition in the .rc file.  I added
> 'LVS_EX_FULLROWSELECT' in place of the 'LVS_SINGLESEL' property,
that's when
> it kicked out the error.  As you see the control is in 'Report' view,
which
> all of these require.
>
> //
>
> After looking around I tried this after the control had been
initialized.
>
> #############
>  m_ctl_vendor_product_list.FullRowSelect(TRUE);
>
> #############
>
> ...it didn't like that either
>
> All the other references were to when the control was actually being
> contructed.  I couldn't find where that was happening
> ...any thoughts?
>
>
>
> "Jeff Partch" <jeffp@mvps.org> wrote in message
> news:efR4kUDVDHA.1316@TK2MSFTNGP12.phx.gbl...
> > "Daniel Canham" <dcanham@rochester.rr.com> wrote in message
> > news:VHOUa.129758$EQ5.38471@twister.nyroc.rr.com...
> > >     I have a large list control with many inventory control items
> > displayed
> > > within.  When someone single clicks on an item, it displays
> > information
> > > about that item in another part of the dialog.  I have a
three-fold
> > problem,
> > > the master list has multiple columns in it, in order to make the
> > selection
> > > work properly, only column 0 can be selected, is there a way to
make a
> > valid
> > > row selection if you select an item using any of the other
columns?
> > Second
> > > issue is the highlight of the selection.  Only column 0 in the
list
> > control
> > > will highlight, is there a way to make the entire row highlight
when
> > any
> > > column in that row is selected?  The third problem I have is
everytime
> > the
> > > list control loses focus, the selected item in column 0 loses its
> > > highlighted status.  I would like to keep that row highlighted no
> > matter
> > > what other controls are used on that dialog.  Any thoughts out
there?
> >
> > Possibly the LVS_SHOWSELALWAYS style and the LVS_EX_FULLROWSELECT
> > extended style.
> > -- 
> > Jeff Partch [VC++ MVP]
> >
> >
>
>


0
jeffp (1711)
7/27/2003 7:14:07 PM
cool, this worked!!  thanks!!


 m_ctl_vendor_product_list.SetExtendedStyle(LVS_EX_FULLROWSELECT);



"Jeff Partch" <jeffp@mvps.org> wrote in message
news:%23May$MHVDHA.2464@TK2MSFTNGP12.phx.gbl...
> TO set an extended listview control style you need to SendMessage it an
> LVM_SETEXTENDEDLISTVIEWSTYLE, or see if you can use the
> CListCtrl::SetExtendedStyle member function.
> -- 
> Jeff Partch [VC++ MVP]
>
>
> "Daniel Canham" <dcanham@rochester.rr.com> wrote in message
> news:MVUUa.42441$wk4.40244@twister.nyroc.rr.com...
> > Ok, I'm feeling a bit stupid now.  LVS_SHOWSELALWAYS works!  Thanks.
> > However, I could find no reference to a full row select option in the
> > control properties.  I tried to add it manually to the .rc file and
> got the
> > following error
> >
> > #############
> > E:\MYPROJECTS\MISC\UpstateApps\UpstateApps.rc (127): error RC2104 :
> > undefined keyword or key name: LVS_EX_FULLROWSELECT
> > Error executing rc.exe.
> > #############
> >
> >     CONTROL         "List2",IDC_VENDOR_PRODUCT_LIST,"SysListView32",
> >                     LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS |
> >                     WS_BORDER | WS_TABSTOP,14,142,185,105
> >
> >     CONTROL         "List2",IDC_VENDOR_PRODUCT_LIST,"SysListView32",
> >                     LVS_REPORT | LVS_EX_FULLROWSELECT |
> LVS_SHOWSELALWAYS |
> >                     WS_BORDER | WS_TABSTOP,14,142,185,105
> >
> >
> > That is the control definition in the .rc file.  I added
> > 'LVS_EX_FULLROWSELECT' in place of the 'LVS_SINGLESEL' property,
> that's when
> > it kicked out the error.  As you see the control is in 'Report' view,
> which
> > all of these require.
> >
> > //
> >
> > After looking around I tried this after the control had been
> initialized.
> >
> > #############
> >  m_ctl_vendor_product_list.FullRowSelect(TRUE);
> >
> > #############
> >
> > ...it didn't like that either
> >
> > All the other references were to when the control was actually being
> > contructed.  I couldn't find where that was happening
> > ...any thoughts?
> >
> >
> >
> > "Jeff Partch" <jeffp@mvps.org> wrote in message
> > news:efR4kUDVDHA.1316@TK2MSFTNGP12.phx.gbl...
> > > "Daniel Canham" <dcanham@rochester.rr.com> wrote in message
> > > news:VHOUa.129758$EQ5.38471@twister.nyroc.rr.com...
> > > >     I have a large list control with many inventory control items
> > > displayed
> > > > within.  When someone single clicks on an item, it displays
> > > information
> > > > about that item in another part of the dialog.  I have a
> three-fold
> > > problem,
> > > > the master list has multiple columns in it, in order to make the
> > > selection
> > > > work properly, only column 0 can be selected, is there a way to
> make a
> > > valid
> > > > row selection if you select an item using any of the other
> columns?
> > > Second
> > > > issue is the highlight of the selection.  Only column 0 in the
> list
> > > control
> > > > will highlight, is there a way to make the entire row highlight
> when
> > > any
> > > > column in that row is selected?  The third problem I have is
> everytime
> > > the
> > > > list control loses focus, the selected item in column 0 loses its
> > > > highlighted status.  I would like to keep that row highlighted no
> > > matter
> > > > what other controls are used on that dialog.  Any thoughts out
> there?
> > >
> > > Possibly the LVS_SHOWSELALWAYS style and the LVS_EX_FULLROWSELECT
> > > extended style.
> > > -- 
> > > Jeff Partch [VC++ MVP]
> > >
> > >
> >
> >
>
>


0
dcanham (24)
7/28/2003 1:11:42 AM
Reply:

Similar Artilces:

POS 2009 Credit Card Swipe problem
Has anyone experienced problems with the MSR not working when migrating from RMS to MS POS 2009? I'm having this issue with my MS POS 2009 install. When my register was running RMS, the IDTECH swipe I have (model #IDT3331-33UB) was properly parsing the CC information into the RMS system's credit card input screen. Now however since upgrading to MS POS 2009, all of the CC info is going into the first field on the credit card data input screen in MS POS 2009 when I do a swipe. I believe the MSR parsing is working correctly as I have reviewed the IDTECH documentation...

Windows 7 problem
When I use the mouse to press a button on my form, if I don't quickly move the mouse the button is automatically pressed again. How do I fix this? Thank you. If this is a command button, you could set its AutoRepeat property to No. In form design view, right-click the button and choose Properties. AutoRepeat is on the Other tab of the properties box. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "KRCMD" <KRCMD@discussions.micr...

List Box Size....
I've created a list box in a cell Data - Data Validation - Allow List The resulting list box containing many values is teeny tiny weeny small. Is there any way the listed information can be shown larger when the user selects this cell? Thanks Inadvance You can't change the font size for a Data Validation dropdown list. However, you can use programming to adjust the zoom setting when the cell is selected. There's some sample code here: http://www.contextures.com/xlDataVal08.html#Larger Wayne wrote: > I've created a list box in a cell > > Data - Data...

Global Address List not updating #3
Hi, We have SBS 2003, and last week I added various Distribution Groups. I added them in the Active Directory and Users tool and they appear there and under Distribution Groups in the Server Managment. However in Outlook, non of these distribution groups appear in the Global Address List. Anyone have an idea what could be wrong or how to force the Global Address List to see the changes? Thanks! What clients are you using? Have you tried a rebuild in ESM? Nue "Lee" <noreply@infinityconcepts.net> wrote in message news:uOC0kHMXGHA.752@TK2MSFTNGP02.phx.gbl... > Hi...

message routing problem !!!!!!!!1
Currently we are running our exchange 5.5 servers in our environment, we have 3 locations and all locations use same e-mail domain, all these locations have seprate NT 4 Domains not joined in a single domain but we can email to all of our locations using same e-mail domain and users in other locations are actually external recepients Now we are willing to upgrade our NT 4 domain environment to windows server 2000 domain and exchange server 2003 but we are facing a problem that we can't mail to users in other locations like we were doing in exchange 5.5 by making them external r...

List Price Update
We are rolling out a last-minute price increase before our trade fair. Would like to update all items of 2 clas IDs by 3.5% in an automated fashion. We do not have Integration Manager, and we coulnd't get it installed before the fair anyways. I can import the item code and list price into Excel and raise the prices, but how can I update the list price field in Dynamics GP? We're on GP 9.00.259. From what I can see SQL is the best bet... anyone know the process to do this? Sean, You are right about that! SQL is your best bet, and here is the query: update IV00105 set listprce ...

fullscreen flash activex control
hello- i'm trying to author a MFC application that has, as its main window, a full screen shockwave/flash activex control with no title bar, borders, etc. what i've done so far is to create a new MFC application that has a single document (using the document/view architecture) in the "new project" wizard, and add the activex control to the main dialog. displaying the window as fullscreen is not the hard part -- i did that by defining BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( cs.hMenu != NULL ) { ::DestroyMenu( cs.hMenu ); cs.hMenu = NULL; ...

Bug in CImageList::DrawIndirect in MFC Version 8
The size of the IMAGELISTDRAWPARAMS struct (defined in CommCtrl.h) depends statically on the value of WINVER. However, CImageList::DrawIndirect overrides the value of the cbSize member according to the runtime version of Comctl32.dll. This messes up the display of images on XP and Vista, when WINVER is set to 0x0500 - as required for applications that can also run on Windows 2000. A workaround is to set imdlp.cbSize to sizeof(IMAGELISTDRAWPARAMS), then call AfxImageList_DrawIndirect(&imldp) instead. > The size of the IMAGELISTDRAWPARAMS struct (defined in CommCtrl.h) depends...

adding date/time picker to inputbox control
Hi all,is there a way to add a date/time picker control to inputbox?...

Output the list of frequent data
Dear all, Here comes two problems. Problem 1: I have a list of strings (say, in the column A1:A100). How can I find the "mode" (i.e. the string appearing most frequently in the list? For example, if the list is APPLE APPLE BANANA APPLE CREAM CREAM BANANA CREAM APPLE DONUT then I want the result is APPLE. It seems that the MODE function does not suppot data type other than numbers. Is there any canned UDF for it? Problem 2: Following Problem 1, I want to generate a list of the 3 most frequent data in the list. If the list is the one in the example, I want to list to be...

HTA problem with IE8
We discovered an issue with some inbedded VBScript code inside an HTA written by a developer that is no longer with us. The code work in IE6 but error out on the set objMsgArea statement indicating that the object requires 'objMenuFrame' which should have been set in the previous line of code. If I put in an 'On Error Resume Next" statement in that sub the HTA appears to work correctly however I don't like putting a band-aid on something like this. Does anyone have any solution for this? Here's the code: sub AppStatusDisplay(strMsgIn, bolAddToStatusLogIn) s...

Sending email in CRM web app problem
Hi, I found this problem very annoying. Our CRM's SMTP service is hosted in YahooMail. The SMTP address is mail.bizmail.yahoo.com and this is a "locked down" server, which means required authentication by username and password. I configured the CRM server's registry by settings the SMTPServerUrl and other stuff, such as Username and password entries. Now, when we send emails from CRM web app, it works... BUT... when we send email using a template which has embedded images, it cannot send the email and reports an error: "Not valid association" something... A...

Problem with 07 Office Pdf/Xps Add-in
Hello Despite having installed the 2007 Office SaveAs Pdf/Xps add-in, I have seen Mary Sauer's posting on this somewhere asking if it in the Add-in of the Office programmes. I do not see it any of the programmes even though I have reinstalled twice with genuine validation. Anything else I can do? Thks. Menk It's like a printer...you print to it. -- ~~~~~~~~~~~~~~~~~~ Rob Giordano Microsoft MVP Expression "Menikos" <menikos88@hotmail.com> wrote in message news:u2EEuVswIHA.4564@TK2MSFTNGP06.phx.gbl... > Hello > > Despite having installed the 200...

Unable to deliver the message due to a recipient problem #3
Hi can anybody help. I check with varies newsgroup but to no scucess. like for example below When you send mail to an X.400 personal address book (PAB) entry or one-off address, you may receive the following non-delivery report (NDR):... However, this one-off entryis not active in our server. ...

CRM 4.0 CTP 3 Workflow problems
I'm trying to create a workflow that triggers on Status Change to the Quote Entity, which will create a new task. When I publish the workflow, and then try to do anything with a quote, I receive an error: You cannot switch the execution context's caller if the context is impersonating the system user. Has anyone else seen this in 4.0, and does anyone know what can be done to fix it? Thank you, Brett Whats the role of the user that has published the workflow? Whats the role of the user that is trying to perform action on the quote? If you unpublish the workflow, does the action ...

Update table with Multi-select list box
I have a database with a tab control that has several pages in it (my boss loves tabs for navigation). Each page has a list box based on a category of training events that members of my office attend and the box is based on a query that selects the training events for the tab page's respective category. I select an item from the list, click a button, and go to a form with a text box showing the name of the training event I previously selected. On that form, I want to select mutiple names of office members from a list box (already created and source is the Office Roster table) and then c...

domain controller
If I have a more powerful comuter than needed, can I run Exchange 2003 on a Windows 2003 domain controller, which happens to be the first domain controller in the domain? Yes, you can though it's not recommended. "rook" <anonymous@discussions.microsoft.com> wrote in message news:7e6901c4849a$4ff93a60$a401280a@phx.gbl... > If I have a more powerful comuter than needed, can I run > Exchange 2003 on a Windows 2003 domain controller, which > happens to be the first domain controller in the domain? Yes it is extreamely not recommended because your so called &qu...

Scanning Problem no one seems to be able to fix
I have been having this problem trying to scan and acquire these files i have. i get all the way to the public box where the documents are, but at the end of an acquire it says "Error in retrieving thumbnail BMP. internal error occurred. connection lost. please refresh." I've had a couple IT guys in here messing with it and still nothing seems to work. I'm just not sure where to look or begin. any help or ideas would be appreciated greatly. thanks -- Travar1410 ------------------------------------------------------------------------ Travar1410's Profile:...

outlook client problem #2
Hi I have a one user that have problem with outlook client are always prompt to login outlook 2007 crmclient V3C and have all patch install You might want to create a new profile for that client. Also check that they are running SQL 2005 Express on their desktop as opposed to an MSDE instance. Their was a shift in databases from 2000 to 2005 during the life of CRM v3.0 "sjm" wrote: > Hi > I have a one user that have problem with outlook client are always prompt to > login > outlook 2007 > crmclient V3C and have all patch install Hi sjm, Is the user also prom...

Book problems and solution for windows 7 09-23-10
Book problems and solution for windows 7 SBN: 978-1-4461-4031-4 / Copyright: ilias el issaoui / Language: English /page : 460 / file : pdf This book takes you step by step to a new world. The world of Windows 7, even if the new system were not know how to use it. Explain everything to you in pictures. You do not need to for a long time to learn In order not to remain afraid of not being able to follow up on your friends, neighbors or family members Problems and solutions for Windows 7 Is a book for all. To small and great. Anyone who wants to learn Do not miss the opportuni...

not really a MFC question
Hi, maybe not the best thread to post but here is my question : I am trying to compile a light version of STL called ustl on win32 but I get the following errors : 1>c:\program files\microsoft visual studio 8\vc\include\ustl\cmemlink.h(61) : error C2535: 'void ustl::cmemlink::link(const void *,ustl::cmemlink::size_type)' : member function already defined or declared 1> c:\program files\microsoft visual studio 8\vc\include\ustl\cmemlink.h(60) : see declaration of 'ustl::cmemlink::link' When i look at source code I find : void link (const void* p, siz...

image list
hi, i want to list images using a list box. can i use CImageList for .gif images? anu ...

Outlook send/receive problem
I have new Dell computer with Office 2003. I set up my earthlink account to work with Outlook, but my test emails just sit in outbox and I cannot receive email. I get the message "an object cannot be found" when trying to send emails stuck in outbox. I have contacted 3 techs at Earthlink, who claims its an MS problem. I reinstalled Office twice & downloaded all Office and XP updates. Help! ...

problem in changing the text of sentences before tables
I am developing a word automation application. In a method of mine, I change the text of some sentences of an opened word file, but the problem is when I change the text of a sentence which located before a table, it will be moved to the first cell of the table. My code is as follow: void myMethod( long startingSentenceNumber, const char *toBeSearched, const char *replacement, bool replace ) { Range currentSentenceRange; Selection sentenceSelection; Sentences sentencesList = m_document.GetSentences(); long sentencesCount = sentencesList.GetCount(); CString replacementCStr(...

save as problem
I cant save my excel file The "save as" option is not eviable. Whats happening? "From a prior post by Ron DeBruin, You can reset your menubar to default. Right click menubar. Customize > Toolbars Tab. Select worksheet menubar. Click Reset button. Using VBA Application : CommandBars(""Worksheet menu bar"").Controls(""File"").Reset Or the whole menubar Application.CommandBars(1).Reset You lost the things you add to the menubar!!" ========================================================== And one link that offers some sugges...