0

我想将窗口窗体颜色从基本蓝色更改为其他。有人可以帮助我们如何做到这一点吗?我只看到表单 ii formborderstyle 的一个属性。

4

4 回答 4

1

实际上,您可以通过在其中添加 CSS 来更改背景颜色。可能看起来有点复杂,但我已经完成并在我的项目中使用它会很容易。您可以尝试参考一下,看看是否有帮助

CSS 标记

<link rel="stylesheet" href="css/style.css" type="text/css" />

我的 css 文件中的 css 代码

body {
 font-family: helvetica, arial, sans-serif;
 background:#FCDFFF; //you can choose the html colour code accordingly

}

在您的 aspx 窗口表单页面中,应该有一个正文。该正文实际上链接到 css 文件中的正文。希望这就是你的意思。这样做的好处是,您可以选择任何颜色。

CSS 颜色代码的 HTML 网页链接。

于 2013-09-03T08:46:07.127 回答
0

你可以试试这个。使用样式属性BODYFORM

<body style="background-color:green; ">
    <form id="form1" runat="server" style ="background-color:green;">
        ...
    </form>
</body>
于 2013-09-03T09:03:27.183 回答
0

you can do it but it will not be easy You have to use P/Invoke for this:

The thing you are trying to achieve is known as Drawing in Non Client Area of Windows Form.

Title Bar(is the place where maximize , minimize , close button resides) of a Windows Form is not in Client Area of it and there is not direct way of painting it.

Anyhow You will get a lot of articles and project on it on Internet here is it:

http://www.codeplex.com/Wiki/View.aspx?ProjectName=CustomerBorderForm&title=Painting%20NonClient%20Area

http://www.codeplex.com/Wiki/View.aspx?ProjectName=CustomerBorderForm

http://www.geekswithblogs.net/kobush/articles/CustomBorderForms.aspx

http://customerborderform.codeplex.com/releases/view/146

reference taken from :http://social.msdn.microsoft.com/Forums/windows/en-US/485fb4c5-8430-4cb5-8a4d-ccd7892e403b/how-to-change-the-title-bar-appearance

于 2013-09-03T09:27:44.040 回答