WEB开发网      濠靛倻鏅悵顖涚附閽樺鐎诲ù婊庡亾缁辨帗鎷呴悩鍨暠濞戞挴鍋撳ù鐘烘閸ㄥ孩绂嶉锝喰﹂柟瀛樺灣濠婃垿鎯冮崟顏嗩伇濞寸姾妫勬慨鈺呭礉濞戝磭骞㈤悹鍥у槻閸ㄥ孩绂嶉敓锟� ---闁挎洩鎷�
开发学院软件开发VC 深入浅出 CPropertySheet 阅读

深入浅出 CPropertySheet

 2006-07-23 11:21:02 来源:WEB开发网 闁靛棴鎷�闁告垵绻愰惃顒傗偓娑欍仦缂嶏拷濠⒀呭仜閵囧洨鈧稒銇炵紞锟�闁靛棴鎷�  闁稿繗娅曢弫鐐哄级閵婏缚鑸瀣仧濞堟垵顕ラ鐓庤Е
核心提示: BOOL CMyPropSheet::OnInitDialog (){BOOL bResult = CPropertySheet::OnInitDialog();int ids[] = { IDOK, IDCANCEL, ID_APPLY_NOW };CRect rectWnd;CRect
BOOL CMyPropSheet::OnInitDialog ()
{
  BOOL bResult = CPropertySheet::OnInitDialog();
  
  int ids[] = { IDOK, IDCANCEL, ID_APPLY_NOW };
  
  CRect rectWnd;
  CRect rectBtn;
  
  GetWindowRect (rectWnd);
  GetDlgItem (IDOK)->GetWindowRect (rectBtn);
  
  int btnWidth = rectBtn.Width();
  int btnHeight = rectBtn.Height();
  int btnOffset = rectWnd.bottom - rectBtn.bottom;
  int btnLeft = rectWnd.right - rectWnd.left;
  rectWnd.bottom = rectBtn.top;
  rectWnd.right = rectWnd.right + btnWidth + btnOffset;
  MoveWindow(rectWnd);
  
  rectBtn.left = btnLeft;
  rectBtn.right = btnLeft + btnWidth;
  for (int i = 0; i < sizeof (ids) / sizeof (int); i++)
  {
    rectBtn.top = (i + 1) * btnOffset + btnHeight * i;
    rectBtn.bottom = rectBtn.top + btnHeight;
    GetDlgItem (ids [i])->MoveWindow (rectBtn);
  }
  
  return bResult;
}

三、改变属性页上的标签文字

首先修改TC_ITEM结构,然后用 SetItem 来修改标签文字,如下代码:

TC_ITEM item;
item.mask = TCIF_TEXT;
item.pszText = "New Label";
//Change the label of the first tab (0 is the index of the first tab)...
GetTabControl ()->SetItem (0, &item);

四、改变属性页标签文字的字体属性

上一页  1 2 3 4  下一页

Tags:深入浅出 CPropertySheet

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接