Print Page | Close Window

Command Bar on Dialog program...

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=10416
Printed Date: 21 December 2024 at 10:02pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Command Bar on Dialog program...
Posted By: rokky05
Subject: Command Bar on Dialog program...
Date 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");




Replies:
Posted By: Oleg
Date Posted: 30 April 2008 at 8:20am
Hi,
Please start from DialogSample in CommandBars folder.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net