我想将表单标题、图标和关闭以及帮助按钮从左侧移动到右侧(更改布局)。
我手动移动了表单控件以保留背景图像,但现在我想更改表单标题。
当我在表单属性中将 rightToLeft 属性设置为 yes 并将 rightToLeftLayout 设置为 true 时,背景图像消失,但它使用属性“BackColor”
我的代码如下:
if (_lang == 'Arabic')
{
this.RightToLeft = RightToLeft.Yes;
this.RightToLeftLayout = true;
}
但它保留按钮图像。
那是为什么呢?
最佳答案
为了进一步说明 Blounty 的回答,MSDN 规范明确指出在使用 RightToLeftLayout 时不支持 BackgroundImage、Opacity 和其他:
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.righttoleftlayout(vs.80).aspx :
Owner draw is not supported when RightToLeftLayout is set to Yes. The owner draw events will still occur, but the behavior of any code you author in these events is not defined. Additionally, BackgroundImage, Opacity, TransparencyKey, and the painting events are not supported.
关于c# - C# Form 中的 RightToLeft 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/400167/