다음을 통해 공유


CToolBar::GetToolBarCtrl

이 멤버 함수 내부 공용 컨트롤에 직접 액세스할 수 있습니다.

CToolBarCtrl& GetToolBarCtrl( ) const;

반환 값

CToolBarCtrl 개체에 대한 참조입니다.

설명

사용 GetToolBarCtrl Windows 도구 모음 공용 컨트롤의 기능을 활용 하 고 지원 활용 하기 위해 CToolBarCtrl 에 대 한 도구 모음 사용자 지정을 제공 합니다.

공용 컨트롤 사용에 대 한 자세한 내용은 컨트롤공용 컨트롤 에 있는 Windows SDK.

예제

// This code fragment is taken from CMainFrame::OnCreate
// CMainFrame is derived from CMDIFrameWnd.

//This example shows how to add text to toolbar buttons.
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE 
   | CBRS_TOP) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
   TRACE0("Failed to create toolbar\n");
   return -1;      // fail to create
}

//Show text on toolbar buttons.
VERIFY(m_wndToolBar.SetButtonText(0, _T("New")));
VERIFY(m_wndToolBar.SetButtonText(1, _T("Open")));
VERIFY(m_wndToolBar.SetButtonText(2, _T("Save")));
VERIFY(m_wndToolBar.SetButtonText(4, _T("Cut")));
VERIFY(m_wndToolBar.SetButtonText(5, _T("Copy")));
VERIFY(m_wndToolBar.SetButtonText(6, _T("Paste")));
VERIFY(m_wndToolBar.SetButtonText(8, _T("Print")));
VERIFY(m_wndToolBar.SetButtonText(9, _T("About")));

CRect temp;
m_wndToolBar.GetItemRect(0, &temp);
m_wndToolBar.GetToolBarCtrl().SetButtonSize(CSize(temp.Width(),
   temp.Height()));

요구 사항

헤더: afxext.h

참고 항목

참조

CToolBar 클래스

계층 구조 차트

CToolBarCtrl 클래스