Click here to Skip to main content
15,892,674 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to create pages in Dialog box plz help Pin
Rajesh R Subramanian4-Jun-08 23:48
professionalRajesh R Subramanian4-Jun-08 23:48 
AnswerRe: How to create pages in Dialog box plz help Pin
Malli_S4-Jun-08 23:49
Malli_S4-Jun-08 23:49 
AnswerRe: How to create pages in Dialog box plz help Pin
Hamid_RT4-Jun-08 23:53
Hamid_RT4-Jun-08 23:53 
QuestionMD5 alg decoding Pin
Nandu_77b4-Jun-08 22:22
Nandu_77b4-Jun-08 22:22 
AnswerRe: MD5 alg decoding Pin
Michael Schubert4-Jun-08 22:39
Michael Schubert4-Jun-08 22:39 
AnswerRe: MD5 alg decoding Pin
Hamid_RT4-Jun-08 23:48
Hamid_RT4-Jun-08 23:48 
AnswerRe: MD5 alg decoding Pin
James R. Twine5-Jun-08 1:19
James R. Twine5-Jun-08 1:19 
QuestionAdding CToolbar on CPropertySheet. Pin
Paresh Chitte4-Jun-08 22:21
Paresh Chitte4-Jun-08 22:21 
Hi,

I have a class derived from CPropertySheet. I have added a CToolbar to this property sheet. I have repositioned the toolbar at right top corner of the property sheet.
However, the property sheet area covers the toolbar and I am able to see only some portion of the toolbar area.

How could I bring the Toolbar on top of property sheet ? (May be at the tabs level but at right side)

I have tried putting a CButton control on the property sheet and is working properly.

Please refer below code to understand the situation.

class CMyPropertySheet : public CPropertySheet
{
	DECLARE_DYNAMIC(CMyPropertySheet)

public:
	CMyPropertySheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	CMyPropertySheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	virtual ~CMyPropertySheet();

protected:
	DECLARE_MESSAGE_MAP()

private:
	CButton m_Button;
	CToolBar m_wndToolBar;

public:
	virtual BOOL OnInitDialog();
	afx_msg void OnButtonClicked();
	afx_msg void OnButton1Clicked();
	afx_msg void OnButton2Clicked();
	void RepositionToolbars();
};

BOOL CMyPropertySheet::OnInitDialog()
{
	BOOL bResult = CPropertySheet::OnInitDialog();

	// TODO:  Add your specialized code here

	m_Button.Create(_T("New Button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, CRect(200,0,300,20), this, ID_BUTTON_ID);

	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT | TBSTYLE_TRANSPARENT, WS_CHILD | WS_VISIBLE | CBRS_TOP 
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndToolBar.LoadToolBar(IDR_TOOLBAR1))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	RepositionToolbars();


	return bResult;
}

void CMyPropertySheet::RepositionToolbars()
{
	// Reposition validation toolbar.
	if(m_wndToolBar)
	{
		m_wndToolBar.GetToolBarCtrl().ModifyStyleEx(SWP_NOMOVE | SWP_NOREPOSITION, SWP_SHOWWINDOW);

		// Calculate toolbar width.
		CSize SizeToolBar;
		m_wndToolBar.GetToolBarCtrl().GetMaxSize(&SizeToolBar);

		CRect rcDlg;
		GetClientRect(&rcDlg);

		int iWidth	= 0;
		int iHeight	= 0;

		iWidth = SizeToolBar.cx;
		iHeight = SizeToolBar.cy;

		int iX		= rcDlg.right-iWidth;
		int iY		= 0;

		m_wndToolBar.GetToolBarCtrl().MoveWindow(iX, iY, iWidth, iHeight);
	}
}

Any help would be highly appreciable.

Regards,
Paresh.
Question.net remoting and C++ Pin
433seenu4-Jun-08 22:13
433seenu4-Jun-08 22:13 
Questionmarquee Pin
Chandrasekharan P4-Jun-08 21:52
Chandrasekharan P4-Jun-08 21:52 
AnswerRe: marquee Pin
Hamid_RT4-Jun-08 21:57
Hamid_RT4-Jun-08 21:57 
GeneralRe: marquee Pin
Chandrasekharan P4-Jun-08 22:02
Chandrasekharan P4-Jun-08 22:02 
AnswerRe: marquee Pin
SandipG 4-Jun-08 22:00
SandipG 4-Jun-08 22:00 
AnswerRe: marquee Pin
Rajesh R Subramanian4-Jun-08 22:40
professionalRajesh R Subramanian4-Jun-08 22:40 
QuestionHow can i get the cpu and mainboard‘s temperature Pin
sirsimonsi4-Jun-08 21:45
sirsimonsi4-Jun-08 21:45 
QuestionC2143 Pin
T.RATHA KRISHNAN4-Jun-08 21:16
T.RATHA KRISHNAN4-Jun-08 21:16 
AnswerRe: C2143 Pin
toxcct4-Jun-08 21:17
toxcct4-Jun-08 21:17 
QuestionRe: C2143 Pin
T.RATHA KRISHNAN4-Jun-08 21:23
T.RATHA KRISHNAN4-Jun-08 21:23 
AnswerRe: C2143 Pin
toxcct4-Jun-08 21:26
toxcct4-Jun-08 21:26 
QuestionRe: C2143 Pin
T.RATHA KRISHNAN4-Jun-08 21:34
T.RATHA KRISHNAN4-Jun-08 21:34 
AnswerRe: C2143 Pin
CPallini4-Jun-08 21:38
mveCPallini4-Jun-08 21:38 
GeneralRe: C2143 Pin
T.RATHA KRISHNAN4-Jun-08 21:40
T.RATHA KRISHNAN4-Jun-08 21:40 
GeneralRe: C2143 Pin
CPallini4-Jun-08 21:49
mveCPallini4-Jun-08 21:49 
AnswerRe: C2143 Pin
toxcct4-Jun-08 21:39
toxcct4-Jun-08 21:39 
QuestionRe: C2143 Pin
T.RATHA KRISHNAN4-Jun-08 22:35
T.RATHA KRISHNAN4-Jun-08 22:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.