_TBBUTTON
luyued 发布于 2011-06-20 05:28 浏览 N 次This structure contains information about a button in a toolbar.
typedef struct _TBBUTTON { int iBitmap; //***加载图 int idCommand; //*** BYTE fsState; BYTE fsStyle; DWORD dwData; int iString; //***加载字符串 } TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON; typedef const TBBUTTON FAR* LPCTBBUTTON;
Members
- iBitmap
- Zero-based index of the button image.
- idCommand
- Command identifier associated with the button. This identifier is used in a WM_COMMAND message when the button is chosen.
- fsState
- Button state flags. It can be a combination of the values listed in Creating a Toolbar.
- fsStyle
- Button style. It can be a combination of the button style values listed in Control Styles.
- dwData
- Specifies an application-defined value.
- iString
- Zero-based index of the button string.
Requirements
OS Versions: Windows CE 1.0 and later.
Header: Commctrl.h.
TBBUTTON tbButton[ICONSUM] = {0};
m_ImageList.Create(32, 32, ILC_COLOR32 | ILC_MASK, 0, 0);//创建图像列表对象
m_ImageList.Add(::AfxGetApp()->LoadIcon(IDI_ICON3));
m_ImageList.Add(::AfxGetApp()->LoadIcon(IDI_ICON1));
m_ImageList.Add(::AfxGetApp()->LoadIcon(IDI_ICON4));
m_ImageList.Add(::AfxGetApp()->LoadIcon(IDI_ICON5));
m_ImageList.Add(::AfxGetApp()->LoadIcon(IDI_ICON2));
m_ToolBar.Create(WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), this, 0);//创建工具栏对象
m_ToolBar.SetImageList(&m_ImageList);//将图像列表关联到工具栏上
for(int i=0; i< ICONSUM; i++)
{
tbButton[i].dwData = NULL;
tbButton[i].fsState = TBSTATE_ENABLED;
tbButton[i].fsStyle = (BYTE)TBSTYLE_FLAT;
tbButton[i].iBitmap = i;
}
tbButton[0].idCommand = ID_ATTENDANCE_RECORD;
tbButton[1].idCommand = IDM_REQUEST_EMPLOYEE;
tbButton[2].idCommand = IDM_PAYLIP;
tbButton[3].idCommand = IDM_PORTFOLIO;
tbButton[4].idCommand = ID_ABOUT;
m_ToolBar.AddButtons(ICONSUM, tbButton);//***添加按钮
m_ToolBar.AutoSize();
m_ToolBar.SetStyle(TBSTYLE_FLAT | CCS_TOP);
m_Menu.LoadMenu(IDR_MAINFRAME_MENU);
SetMenu(&m_Menu);
- 07-01· 禁教唐诗算术能还幼儿快
- 07-01· 2011年06月17日
- 07-01· 唐诗宋词英译:李商隐 筹
- 07-01· 仿评《唐诗1000首》第186首
- 07-01· 没事干的时候背背唐诗吧
- 07-01· [转载]唐诗中“斜”字该读
- 07-01· 湖南醴陵瓷业转型升级
- 07-01· 奇瑞风云2两厢黑色|2010款
- 07-01· 摩根士丹利华鑫摩根士丹
- 07-01· 摩根士丹利华鑫近期优选
- 07-01· 中金投行部大摩出售中金
- 07-01· 摩根士丹利招聘6月2日【实
- 07-01· 营养防病圣典
- 07-01· 《博伽梵歌原意》之第十
- 07-01· [不错]斑斓圣典---减肥中常
- 07-01· 武乐圣典《太极武当》:武
- 07-01· 铁血英雄-现阶段战功牌兑
- 07-01· 2011年06月10日【原创】南歌
- 07-01· 【淘宝网信息】- 2010年的
- 07-01· 深圳品牌女装有哪些?