表格RightToLeft属性在C# [英] RightToLeft property in Form in C#

查看:190
本文介绍了表格RightToLeft属性在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想移动窗体标题,图标和关闭,并帮助从左侧按钮右侧(更改布局)。

I want to move the form title, icon and close, and help buttons from left side to right side (change the layout).

我把表单控件手动保持背景图像,但现在我想改变窗体标题。

I moved the form controls manually to keep background image but now I want to change the form title.

当我在窗体属性背景图像消失RightToLeft属性设置为yes和rightToLeftLayout设置为true,但它使用的财产背景色

When I set rightToLeft property to yes and rightToLeftLayout to true in the form properties the background image disappears, but it uses the property "BackColor"

我的代码如下:

if (_lang == 'Arabic')
{
    this.RightToLeft =  RightToLeft.Yes;
    this.RightToLeftLayout = true;
}



但它使按钮图像。

But it keeps buttons image.

那么,为什么会这样?

推荐答案

要进一步Blounty的回答,在MSDN规范明确指出的BackgroundImage,不透明度和使用RightToLeftLayout当别人不支持:

To further Blounty's answer, the MSDN specs clearly state that BackgroundImage, Opacity and others aren't supported when using RightToLeftLayout:

http://msdn.microsoft.com/en-us/library/system.windows.forms.form.righttoleftlayout(VS.80)的.aspx

所有者绘制。雇主绘制仍然会发生的事件,但没有定义的你在这些事件中创作的任何代码的行为。此外,的BackgroundImage,不透明,不支持TransparencyKey和绘画活动。

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.

这篇关于表格RightToLeft属性在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆