Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Command Bar on Dialog program...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Command Bar on Dialog program...

 Post Reply Post Reply
Author
Message
rokky05 View Drop Down
Groupie
Groupie


Joined: 04 February 2008
Location: Ukraine
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote rokky05 Quote  Post ReplyReply Direct Link To This Post Topic: Command Bar on Dialog program...
    Posted: 30 April 2008 at 6:53am
Hi, I need display CommandBar with ComboBox on Dialog program (not MDI), you can prompt how to do it?
I do so: (in function OnInitDialog())
 

// Get a pointer to the command bars object.

CXTPCommandBars* pCommandBars = NULL; // here mast be pointer on command bars object but dialog does not have command bar...

if(pCommandBars == NULL)

{

TRACE0("Failed to create command bars object.\n");

return -1; // fail to create

}

// Set Office 2003 Theme

CXTPPaintManager::SetTheme(xtpThemeOffice2003);

CXTPToolBar* pToolBarCombo = pCommandBars->Add(_T("Combo"), xtpBarTop);

pToolBarCombo->SetBarID(IDR_MAINFRAME + 3);

pToolBarCombo->GetControls()->Add(xtpControlLabel, 0)->SetCaption(_T("My ComboBox:"));

CXTPControlComboBox* pControlCombo = (CXTPControlComboBox*)pToolBarCombo->GetControls()->Add(xtpControlComboBox, ID_FILE_NEW);

pControlCombo->SetDropDownListStyle();

pControlCombo->SetEditText(L"My ComboBox");

pControlCombo->AddString(L"First");

pControlCombo->AddString(L"Second");

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 30 April 2008 at 8:20am
Hi,
Please start from DialogSample in CommandBars folder.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.