Click here to Skip to main content
15,912,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Connect to internet Pin
Mazdak5-Dec-02 23:26
Mazdak5-Dec-02 23:26 
GeneralRe: Connect to internet Pin
georgiek506-Dec-02 1:02
georgiek506-Dec-02 1:02 
QuestionHow to format hard drive to FAT or FAT32 format ? Pin
manio5-Dec-02 21:54
manio5-Dec-02 21:54 
AnswerRe: How to format hard drive to FAT or FAT32 format ? Pin
Nitron6-Dec-02 13:40
Nitron6-Dec-02 13:40 
GeneralMDI Initial Document Pin
Dov Sherman5-Dec-02 21:27
Dov Sherman5-Dec-02 21:27 
GeneralRe: MDI Initial Document Pin
Roger Allen5-Dec-02 21:54
Roger Allen5-Dec-02 21:54 
GeneralRe: MDI Initial Document Pin
Taka Muraoka5-Dec-02 21:55
Taka Muraoka5-Dec-02 21:55 
GeneralKeeping Row Selected in ListView Control Pin
Anonymous5-Dec-02 21:03
Anonymous5-Dec-02 21:03 
Hi everyone. Now I know how to select a row in code, so here is another similar question. I have a listview on a dialog, and the first row in the list view is selected on oninitdialog (there is always entries in the list view). Problem is, I don't want the list view to deselect the row if the user clicks whitespace (such as blank area below the last row in the list view). Usually the listview deselects any rows when this whitespace is clicked. I tried the following code, the idea being keep the last row selected before whitespace was clicked, so in effect you can never deselect a row:

<br />
void CMyDlg::OnClickLvwEmails(NMHDR* pNMHDR, LRESULT* pResult) <br />
{<br />
//	int iSelected;<br />
<br />
	// prevent the user from deselecting an item by clicking whitespace!<br />
	iSelected = m_lvwEMails.GetNextItem(-1, LVNI_SELECTED);<br />
	if(iSelected == -1)<br />
	{<br />
		m_lvwEMails.SetItemState(m_iPreviouslySelectedItem, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);<br />
	}<br />
	else<br />
	{<br />
		m_iPreviouslySelectedItem = iSelected;<br />
	}<br />
	*pResult = 0;<br />
}<br />


This seemed to work, except when the user clicks on the list view in the exact same spot twice with the mouse. Then the last row highlighed would be deselected. But if you click different areas in the whitespace, it keeps the last selected row selected. Anyone know a better way to do this? Thanks!
GeneralRe: Keeping Row Selected in ListView Control Pin
KaЯl6-Dec-02 2:24
KaЯl6-Dec-02 2:24 
GeneralVc++ Brouse Info file Pin
Hemant kulkarni5-Dec-02 20:02
Hemant kulkarni5-Dec-02 20:02 
Generalplugins in vc++ Pin
xxhimanshu5-Dec-02 19:18
xxhimanshu5-Dec-02 19:18 
GeneralRe: plugins in vc++ Pin
User 66585-Dec-02 23:45
User 66585-Dec-02 23:45 
QuestionDECLARE_DYNCREATE/DECLARE_DYNAMIC?? Pin
liuty20065-Dec-02 17:35
liuty20065-Dec-02 17:35 
AnswerRe: DECLARE_DYNCREATE/DECLARE_DYNAMIC?? Pin
Holger Persch5-Dec-02 19:46
Holger Persch5-Dec-02 19:46 
GeneralA question about scope in VC++6 / MFC Pin
Overt Metrication5-Dec-02 17:20
Overt Metrication5-Dec-02 17:20 
GeneralRe: A question about scope in VC++6 / MFC Pin
Christian Graus5-Dec-02 17:25
protectorChristian Graus5-Dec-02 17:25 
GeneralRe: A question about scope in VC++6 / MFC Pin
Overt Metrication5-Dec-02 17:29
Overt Metrication5-Dec-02 17:29 
GeneralCreating an object Pin
SAV5-Dec-02 17:16
SAV5-Dec-02 17:16 
GeneralRe: Creating an object Pin
Christian Graus5-Dec-02 17:27
protectorChristian Graus5-Dec-02 17:27 
GeneralRe: Creating an object Pin
Nitron6-Dec-02 13:43
Nitron6-Dec-02 13:43 
GeneralRe: Creating an object Pin
SAV6-Dec-02 18:35
SAV6-Dec-02 18:35 
GeneralShow window content while dragging... Pin
Neha5-Dec-02 17:03
Neha5-Dec-02 17:03 
GeneralRe: Show window content while dragging... Pin
Paul M Watt5-Dec-02 17:12
mentorPaul M Watt5-Dec-02 17:12 
GeneralRe: Show window content while dragging... Pin
Shog95-Dec-02 17:45
sitebuilderShog95-Dec-02 17:45 
GeneralRe: Show window content while dragging... Pin
Nyil14-Jul-08 1:36
Nyil14-Jul-08 1:36 

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.