0

I have a very small problem with Visual C++: when I try to put a word or sentence contaning a & symbol into static text, I see that & symbol as _ on the screen.

Thanks for any help.

int CustomerID;

CString Str= m_lv1.GetItemText(iItem, 0); Str.TrimLeft(); Str.TrimRight();      

//if the Str "Hello & Hi" it shows "Hello _ Hi"
m_CustomerName.SetWindowText(Str);
4

2 回答 2

3

MSVC 用于&表示用于菜单和其他小部件的带下划线的字母,您可以使用 Alt 来通过键盘控制您的 UI。double&&应该代表&文本中的一个,iirc。

于 2012-06-27T17:23:09.507 回答
1

您可以将 '&&' 用于单个 & (不充当快捷方式),或设置SS_NOPREFIX样式以完全抑制 & 符号处理。

于 2012-07-02T19:12:26.630 回答