C#宝石如何获得文本框或形状的位置

发布于 2025-01-26 02:02:01 字数 552 浏览 3 评论 0原文

我想知道如何在Gembox DLL中获得文本框或形状的位置。

这是我的文本框:

var textBox1 = new TextBox(document, Layout.Floating(
    new HorizontalPosition(15, LengthUnit.Pixel, HorizontalPositionAnchor.TopLeftCorner),
    new VerticalPosition(70, LengthUnit.Pixel, VerticalPositionAnchor.TopLeftCorner),
    new Size(pageSetup.PageWidth - 175, 100, LengthUnit.Point)),
    ShapeType.RoundedRectangle);

textBox1.AdjustValues["adj"] = 5000;
textBox1.Outline.Fill.SetEmpty();
textBox1.Fill.SetSolid(Color.White);

现在我想访问水平和垂直位置。

感谢您的帮助。

I was wondering how I can get the position of a TextBox or a Shape inside the GemBox DLL.

This is my TextBox:

var textBox1 = new TextBox(document, Layout.Floating(
    new HorizontalPosition(15, LengthUnit.Pixel, HorizontalPositionAnchor.TopLeftCorner),
    new VerticalPosition(70, LengthUnit.Pixel, VerticalPositionAnchor.TopLeftCorner),
    new Size(pageSetup.PageWidth - 175, 100, LengthUnit.Point)),
    ShapeType.RoundedRectangle);

textBox1.AdjustValues["adj"] = 5000;
textBox1.Outline.Fill.SetEmpty();
textBox1.Fill.SetSolid(Color.White);

Now I want to get access to the Horizontal and Vertical position.

Thanks for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独夜无伴 2025-02-02 02:02:01

使用以下方式:

if (textBox1.Layout.IsFloating)
{
    var layout = (FloatingLayout)textBox1.Layout;
    var horizontalPosition = layout.HorizontalPosition;
    var verticalPosition = layout.VerticalPosition;
    // ...
}

Use this:

if (textBox1.Layout.IsFloating)
{
    var layout = (FloatingLayout)textBox1.Layout;
    var horizontalPosition = layout.HorizontalPosition;
    var verticalPosition = layout.VerticalPosition;
    // ...
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文