本文整理汇总了C++中CComboBox::SetFocus方法的典型用法代码示例。如果您正苦于以下问题:C++ CComboBox::SetFocus方法的具体用法?C++ CComboBox::SetFocus怎么用?C++ CComboBox::SetFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComboBox
的用法示例。
在下文中一共展示了CComboBox::SetFocus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnFviewFmtBest
void ViewFilesDialog::OnFviewFmtBest(void)
{
CComboBox* pCombo = (CComboBox*) GetDlgItem(IDC_FVIEW_FORMATSEL);
pCombo->SetCurSel(0); // best is always at the top
OnFormatSelChange();
pCombo->SetFocus();
}
示例2: OnInitDialog
BOOL CTagDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
// if tagging line don't add items to combobox
if (tagLine) {
return TRUE;
}
// Add items from tag lists to the combobox depending on data type
switch (dataType) {
case 0 :
{
for (int i=0; i<boolTags->GetSize(); i++) {
m_Tag.AddString(boolTags->GetAt(i));
}
break;
}
case 1 :
{
for (int i=0; i<intTags->GetSize(); i++) {
m_Tag.AddString(intTags->GetAt(i));
}
break;
}
case 2 :
{
for (int i=0; i<realTags->GetSize(); i++) {
m_Tag.AddString(realTags->GetAt(i));
}
break;
}
case 3 :
{
for (int i=0; i<stringTags->GetSize(); i++) {
m_Tag.AddString(stringTags->GetAt(i));
}
break;
}
case 4 :
{
for (int i=0; i<eventTags->GetSize(); i++) {
m_Tag.AddString(eventTags->GetAt(i));
}
break;
}
}
CComboBox* pCombo = (CComboBox*)GetDlgItem(IDC_TAG_COMBO);
if(pCombo != NULL) {
pCombo->SetFocus();
return 0; //since we are explicity setting focus
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例3: OnFviewFmtRaw
void ViewFilesDialog::OnFviewFmtRaw(void)
{
CComboBox* pCombo = (CComboBox*) GetDlgItem(IDC_FVIEW_FORMATSEL);
int sel = FindByVal(pCombo, ReformatHolder::kReformatRaw);
if (sel < 0)
sel = 0;
pCombo->SetCurSel(sel);
OnFormatSelChange();
pCombo->SetFocus();
}
示例4: OnInitDialog
BOOL CEnterOptionsNameDlg::OnInitDialog() {
__super::OnInitDialog();
CComboBox *cb = getNameCombo();
const StringArray names = Options::getExistingNames();
for(size_t i = 0; i < names.size(); i++) {
cb->AddString(names[i].cstr());
}
cb->SetFocus();
if((cb->GetCount() == 0) || (m_name.GetLength() == 0)) {
cb->SetCurSel(0);
} else {
cb->SetCurSel((int)names.getFirstIndex((LPCTSTR)m_name));
}
return false;
}
示例5: OnInitDialog
//初始化函数
BOOL CSetChip::OnInitDialog()
{
__super::OnInitDialog();
//设置标题
SetWindowText(TEXT("压注"));
//计算押注
LONG lChipsArray[SET_CHIP_COUNT] ;
//数据验证
ASSERT( m_wMaxChip > 0 ) ;
if ( m_wMaxChip <= 0 ) return TRUE ;
for ( BYTE cbChipIndex = 0; cbChipIndex < SET_CHIP_COUNT; ++cbChipIndex )
{
lChipsArray[cbChipIndex] = LONG ( ( cbChipIndex + 1.0 ) / SET_CHIP_COUNT * m_wMaxChip ) ;
//整百处理
if ( lChipsArray[cbChipIndex] > 100 )
{
LONG lHundredCount = lChipsArray[cbChipIndex] / 100 ;
lChipsArray[cbChipIndex] = lHundredCount * 100 ;
}
}
//插入押注
CComboBox *pChipComBox = ( CComboBox* ) GetDlgItem( IDC_SETCHIP ) ;
CString strChip ;
for ( BYTE cbChipIndex = 0; cbChipIndex < SET_CHIP_COUNT; ++cbChipIndex )
{
strChip.Format( TEXT( "%ld" ), lChipsArray[cbChipIndex] ) ;
pChipComBox->InsertString( cbChipIndex, strChip ) ;
}
pChipComBox->SetCurSel( 0 ) ;
pChipComBox->SetFocus() ;
m_nChip = lChipsArray[0] ;
return TRUE;
}