C#中Form中的RightToLeft属性

我想从左侧到右侧移动表单标题,图标和关闭以及帮助按钮(更改布局)。

我手动移动表单控件以保留背景图像,但现在我想更改表单标题。

当我在表单属性中将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 :

当RightToLeftLayout设置为Yes时,不支持所有者绘制。 所有者绘制事件仍将发生,但未定义您在这些事件中创作的任何代码的行为。 此外,不支持BackgroundImage,Opacity,TransparencyKey和绘画事件。

当RightToLeftLayout设置为yes时,不支持BackgroundImage,Opacity,TransparencyKey和绘制事件。

替换丢失的function非常容易:

 protected override void OnPaintBackground(PaintEventArgs e) { Rectangle rc = new Rectangle(Point.Empty, this.ClientSize); e.Graphics.DrawImage(Properties.Resources.SampleImage, rc); } 

如果需要平铺图像,则需要做更多工作。