gpt4 book ai didi

c# - C# 中 RectangleShape 的边框样式

转载 作者:太空宇宙 更新时间:2023-11-03 23:00:24 24 4
gpt4 key购买 nike

我一直在用 C# 编写一个应用程序,它需要 Visual Studio Powerpack 的 RectangleShape 的其中一种形式。一个问题突然出现了。 RectangleShape 的 BorderStyle 不包含“无”选项。然后我选择“自定义”作为临时解决方案,然后将 borderWidth 设置为 0,这不可能吗? 我如何才能将 RectangleShape 的 borderstyle 设置为不启用或根本不存在?

最佳答案

这是设计使然的行为。 BorderStyle 是一个 DashStyle

该属性继承自 Shape。参见 documentation :

一方面,

For an OvalShape or RectangleShape control, BorderStyle represents the style of the shape itself when the BackStyle property is set to Transparent.

另一方面,

When the BackStyle property is set to Opaque, the BorderStyle represents the style of the outer edges of the shape.

在您的情况下,最简单的解决方案可能是使用 Solid 并为边框和背景设置相同的颜色。如果这不是您的设计目标,请在您的问题中添加更多信息。

关于c# - C# 中 RectangleShape 的边框样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43351899/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com