简体   繁体   English

如何在多行文字C ++的左上角显示复选框

[英]How to show checkbox in the top left corner of its multiline text C++

Is there a way to do this? 有没有办法做到这一点? Also, the lower text is truncated when I set it as multiline. 此外,当我将其设置为多行时,下部文本将被截断。 Is there a way to increase the size of rect for the checkbox so that the multiline string fits in it. 有没有一种方法可以增加rect的大小,以便多行字符串适合其中。

Thank you very much. 非常感谢你。

Top is possible. 最高可能。

Left is doubtful. 左是值得怀疑的。 you can try it. 你可以试试。

In the below link look for "Text Alignment Styles" 在下面的链接中查找“文本对齐样式”

https://msdn.microsoft.com/en-us/library/tf9hd91s.aspx https://msdn.microsoft.com/en-us/library/tf9hd91s.aspx

For setting the style use, 为了设置样式用途,

CButton::SetButtonStyle(UINT nStyle,BOOL bRedraw = TRUE)

Look for documentation here in below link 在下面的链接中查找文档

https://msdn.microsoft.com/en-us/library/yf1wax6c.aspx#cbutton__setbuttonstyle https://msdn.microsoft.com/en-us/library/yf1wax6c.aspx#cbutton__setbuttonstyle

for multiline fit probably you have to set the style to button using "setButtonStyle" with an option "BS_MULTILINE". 对于多行拟合,可能必须使用“ setButtonStyle”和选项“ BS_MULTILINE”将样式设置为按钮。

Use a CheckBox together with a Static . CheckBoxStatic一起使用。 My experience tells me that this workaround is good for many reasons. 我的经验告诉我,由于多种原因,这种解决方法很好。 (Eg you can easily make the checkbox look transparent, which would otherwise be excruciatingly hard.) (例如,您可以轻松地使复选框看起来透明,否则这将非常困难。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM