CToolBarCtrl::AddStrings

添加一个新字符串为字符串列表可用于工具栏控件。

int AddStrings(
   LPCTSTR lpszStrings 
);

参数

  • lpszStrings
    包含缓冲区的地址添加的一个或多个Null终止的字符串到工具栏的字符串列表。 必须停止最后一个字符串包含两个null字符。

返回值

添加的第一个新字符串的从零开始的索引,如果成功;否则– 1。

备注

必须用一个null字符分隔。缓冲区的字符串。 您必须确保最后一个字符串具有两个null结束符。 适当地设置常数字符串,可以将其写如下所示:

// one null added automatically
lpszStrings = _T("Only one string to add\0");   

或:

// adds three strings with one call
lpszStrings = _T("String 1\0String 2\0String 3\0");   

因为在以上 CString,的null字符是不可能的不应传递给此函数的一 CString 对象。

要求

Header: afxcmn.h

请参见

参考

CToolBarCtrl选件类

层次结构图

CToolBarCtrl::AddString

CToolBarCtrl::AddButtons

CToolBarCtrl::InsertButton

CToolBarCtrl::AddBitmap