Wiki Job SetCurSel();

06/20/2019 06:15 lasdra03#1
I was wondering about this Wiki that I leeched, so if the codes are this

Code:
	
m_pListItems = (CWndListBox*)GetDlgItem(WIDC_LISTBOX1);
	m_pComboJob = (CWndComboBox*)GetDlgItem(WIDC_COMBOBOX2);
	m_pComboKind = (CWndComboBox*)GetDlgItem(WIDC_COMBOBOX1);
	m_pEditFilter = (CWndEdit*)GetDlgItem(WIDC_EDIT1);

	int nIdx = 0;
	for( int i = 0; i < MAX_JOB; ++i )
	{
		if( i == JOB_PUPPETEER || i == JOB_DOPPLER || i == JOB_GATEKEEPER )
			continue;
		nIdx = m_pComboJob->AddString(prj.m_aJob[i].szName);
		m_pComboJob->SetItemData(nIdx,i);
		m_pComboJob->SetCurSel(0);
	}
And it says
Quote:
m_pComboJob->SetCursel(0);
Why do still do this? Don't have a scroll down..
[Only registered and activated users can see links. Click Here To Register...]

Up
06/20/2019 16:22 Knusper02#2
In WndControl.cpp
Search for this function:
Code:
int CWndComboBox::AddString( LPCTSTR lpszString )
Change it to:
Code:
int CWndComboBox::AddString( LPCTSTR lpszString )
{
	int nNum = m_wndListBox.AddString( lpszString );
	CRect rect = m_wndListBox.GetWindowRect( TRUE );
	rect.bottom = rect.top + ( ( nNum + 1 ) * ( m_pFont->GetMaxHeight() + 3 ) ) + 8;
	if( rect.Height() > 400 )
		rect.bottom = rect.top + 400;
	m_wndListBox.SetWndRect( rect );
	return nNum;
}
06/20/2019 18:29 lasdra03#3
Quote:
Originally Posted by Knusper02 View Post
In WndControl.cpp
Search for this function:
Code:
int CWndComboBox::AddString( LPCTSTR lpszString )
Change it to:
Code:
int CWndComboBox::AddString( LPCTSTR lpszString )
{
	int nNum = m_wndListBox.AddString( lpszString );
	CRect rect = m_wndListBox.GetWindowRect( TRUE );
	rect.bottom = rect.top + ( ( nNum + 1 ) * ( m_pFont->GetMaxHeight() + 3 ) ) + 8;
	if( rect.Height() > 400 )
		rect.bottom = rect.top + 400;
	m_wndListBox.SetWndRect( rect );
	return nNum;
}
Sweet lord! Thank you mate! It worked, I am looking around for 2 days already it been out of the codes. Thanks again!