首页
社区
课程
招聘
[求助]ReBar里的多个ToolBar的位置
发表于: 2010-8-23 22:13 4142

[求助]ReBar里的多个ToolBar的位置

2010-8-23 22:13
4142
在ReBar里创建了两个ToolBar,却总是只能在同一行显示,怎样才好创建时就设定为在两行显示的>
不用MoveWindow的话...
以下代码抄袭自网上流传的ReBar带Combo Box那段:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Initialize structure members that both bands will share.
   rbBand.cbSize = sizeof(REBARBANDINFO);  // Required
   rbBand.fMask  = RBBIM_COLORS | RBBIM_TEXT | RBBIM_BACKGROUND |
                   RBBIM_STYLE | RBBIM_CHILD  | RBBIM_CHILDSIZE;
   rbBand.fStyle = RBBS_NOVERT | RBBS_CHILDEDGE | RBBS_FIXEDBMP;
    
   rbBand.hbmBack = NULL;
 
   // Create the toolbar control to be added.
   hwndTB = CreateToolbar(hwndOwner);   //Create ToolBar1
 
   // Get the height of the toolbar.
   dwBtnSize = (int)SendMessage(hwndTB, TB_GETBUTTONSIZE, 0,0);
 
   // Set values unique to the band with the toolbar.
   rbBand.lpText        = TEXT("Tool Bar");
   rbBand.hwndChild     = hwndTB;
   rbBand.cxMinChild    = 0;
   rbBand.cyMinChild    = HIWORD(dwBtnSize);
//   rbBand.cx          = 0;
 
   // Add the band that has the toolbar.
   SendMessage(hwndRB, RB_INSERTBAND, (WPARAM)0, (LPARAM)&rbBand);
   SendMessage(hwndRB, RB_SETBANDINFO, -1, (LPARAM)(LPREBARBANDINFO)&rbBand);
    
   //////////////////////////////////////////////////////////////////////////
   hToolBar = CCToolbarIMG(hwndOwner);  //Create ToolBar2
   // Set values unique to the band with the toolBar2.
   GetWindowRect(hToolBar, &rc);
   rbBand.lpText        = NULL;
 
   //rbBand.fStyle      = RBBS_BREAK;
 
   rbBand.hwndChild     = hToolBar;
   //rbBand.cxMinChild  = 0;
   rbBand.cxMinChild    = (WORD)SendMessage(hToolBar, TB_GETBUTTONSIZE, 0, 0)*SendMessage(hToolBar, TB_BUTTONCOUNT, 0, 0);
   rbBand.cyMinChild    = rc.bottom - rc.top;
   //rbBand.cx          = 100;
   rbBand.cx            = rbBand.cxMinChild;
    
   // Add the band that has the combo box.
   SendMessage(hwndRB, RB_INSERTBAND, (WPARAM)2, (LPARAM)&rbBand);
   SendMessage(hwndRB, RB_SETBANDINFO, 2, (LPARAM)(LPREBARBANDINFO)&rbBand);

   不知哪位做过的提个醒?

[注意]看雪招聘,专注安全领域的专业人才平台!

收藏
免费
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回

账号登录
验证码登录

忘记密码?
没有账号?立即免费注册