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

C / C++ / MFC

 
AnswerRe: C++ Vector object question Pin
markkuk14-Aug-18 23:51
markkuk14-Aug-18 23:51 
GeneralRe: C++ Vector object question Pin
samzcs15-Aug-18 2:28
samzcs15-Aug-18 2:28 
GeneralRe: C++ Vector object question Pin
Richard MacCutchan15-Aug-18 2:38
mveRichard MacCutchan15-Aug-18 2:38 
GeneralRe: C++ Vector object question Pin
samzcs15-Aug-18 2:55
samzcs15-Aug-18 2:55 
GeneralRe: C++ Vector object question Pin
Richard MacCutchan15-Aug-18 4:29
mveRichard MacCutchan15-Aug-18 4:29 
GeneralRe: C++ Vector object question Pin
samzcs15-Aug-18 3:32
samzcs15-Aug-18 3:32 
GeneralRe: C++ Vector object question Pin
Richard MacCutchan15-Aug-18 4:33
mveRichard MacCutchan15-Aug-18 4:33 
GeneralRe: C++ Vector object question Pin
markkuk15-Aug-18 12:07
markkuk15-Aug-18 12:07 
GeneralRe: C++ Vector object question Pin
samzcs16-Aug-18 3:44
samzcs16-Aug-18 3:44 
QuestionRetrieve HWND of a control that has focus Pin
_Flaviu10-Aug-18 1:27
_Flaviu10-Aug-18 1:27 
QuestionRe: Retrieve HWND of a control that has focus Pin
David Crow10-Aug-18 3:45
David Crow10-Aug-18 3:45 
AnswerRe: Retrieve HWND of a control that has focus Pin
_Flaviu10-Aug-18 3:56
_Flaviu10-Aug-18 3:56 
AnswerRe: Retrieve HWND of a control that has focus Pin
_Flaviu10-Aug-18 4:36
_Flaviu10-Aug-18 4:36 
GeneralRe: Retrieve HWND of a control that has focus Pin
David Crow10-Aug-18 4:58
David Crow10-Aug-18 4:58 
AnswerRe: Retrieve HWND of a control that has focus Pin
leon de boer10-Aug-18 6:57
leon de boer10-Aug-18 6:57 
GeneralRe: Retrieve HWND of a control that has focus Pin
_Flaviu11-Aug-18 21:08
_Flaviu11-Aug-18 21:08 
GeneralRe: Retrieve HWND of a control that has focus Pin
Richard MacCutchan11-Aug-18 21:56
mveRichard MacCutchan11-Aug-18 21:56 
GeneralRe: Retrieve HWND of a control that has focus Pin
_Flaviu13-Aug-18 0:09
_Flaviu13-Aug-18 0:09 
GeneralRe: Retrieve HWND of a control that has focus Pin
Randor 13-Aug-18 1:51
professional Randor 13-Aug-18 1:51 
GeneralRe: Retrieve HWND of a control that has focus Pin
leon de boer12-Aug-18 3:47
leon de boer12-Aug-18 3:47 
QuestionWhat is the magic incantation to select a row in a CListCtrl in report mode ? Pin
Maximilien9-Aug-18 9:09
Maximilien9-Aug-18 9:09 
GeneralRe: What is the magic incantation to select a row in a CListCtrl in report mode ? Pin
David Crow9-Aug-18 9:47
David Crow9-Aug-18 9:47 
Something seems amiss here. I dummied up a project with VS2008 and your code seems to do what is expected.
CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,14,15,278,153
...
BOOL CTempDlg::OnInitDialog()
{
    CDialog::OnInitDialog();

    // m_PositionListBox is a CListCtrl
    m_PositionListBox.InsertColumn(0, _T("Name"), LVCFMT_LEFT, 100);

    m_PositionListBox.InsertItem(0, _T("Ford"));
    m_PositionListBox.InsertItem(1, _T("Chevrolet"));
    m_PositionListBox.InsertItem(2, _T("Honda"));
    m_PositionListBox.InsertItem(3, _T("Toyota"));
    m_PositionListBox.InsertItem(4, _T("GMC"));
    m_PositionListBox.InsertItem(5, _T("Jeep"));
    
    return TRUE;
}
...
void CTempDlg::OnBnClickedSet()
{
    int nItem = 3;
    m_PositionListBox.SetFocus();
    m_PositionListBox.SetItemState(nItem, LVIS_SELECTED, LVIS_SELECTED);
}
When I click the Set button, item #3 (Toyota) is selected (blue). If I then press the Tab key, focus goes to the OK button but item #3 stays selected (gray).

"One man's wage rise is another man's price increase." - Harold Wilson

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles



modified 10-Aug-18 9:43am.

GeneralRe: What is the magic incantation to select a row in a CListCtrl in report mode ? Pin
Maximilien9-Aug-18 12:06
Maximilien9-Aug-18 12:06 
GeneralRe: What is the magic incantation to select a row in a CListCtrl in report mode ? Pin
Maximilien21-Aug-18 5:11
Maximilien21-Aug-18 5:11 
Questionhow to use recursive descent algorithm to compute an arithmetical expression? Pin
tony_ming8-Aug-18 20:42
tony_ming8-Aug-18 20:42 

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.