我正在使用 MFC。
我正在尝试实现带有错误图标消息的验证文本框。
即:
但是当我点击文本框时,“x”图标消失了。
我在尝试什么:
m_myXIcon->SetWindowPos(&CWnd::wndTopMost, 0, 0, 0, 0,
SWP_NOMOVE|SWP_NOSIZE);
我该如何解决?
谢谢! :)
最佳答案
您需要确保文本区域不与您的图标重叠。为此,使用 CEdit::SetMargins
CEdit::SetMargins
Call this method to set the left and right margins of this edit control. Syntax
void SetMargins( UINT nLeft, UINT nRight );
Parameters
nLeft
The width of the new left margin, in pixels.
nRight
The width of the new right margin, in pixels.
关于c++ - 尝试在 MFC 上实现 TextBox 错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35549624/