2.2.6.19.19 ListBox::SetSel

Description

Syntax

int SetSel( int nIndex, BOOL bSelect = TRUE )

Parameters

nIndex
bSelect

Return

Examples

EX1

#include <..\OriginLab\DialogEx.h>   // Dialog class

#define IDC_LIST1 1001

void ListBox_SetSel(Dialog& MyDlg)
{
	ListBox  m_List = MyDlg.GetItem(IDC_LIST1);    
	// Select all of the items with an even index and
	// deselect all others.
	for( int i = 0; i < m_List.GetCount(); i++ )
	{
		m_List.SetSel(i, ((i%2) == 0));
	}
}

Remark

See Also

Header to Include

Control.h