如何绘制分隔符?

发布于 2024-09-02 14:11:14 字数 343 浏览 5 评论 0原文

我正在使用 Windows API 用 C 进行编程,并且想知道如何绘制分隔符。我希望有一个代码示例。

编辑:这是一个插图。

替代文本
(来源:microsoft.com

I am programming in C, using the Windows API, and would like to know how I could draw separators. I would appreciate a code example.

Edit: Here's an illustration.

alt text
(source: microsoft.com)

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

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

发布评论

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

评论(4

背叛残局 2024-09-09 14:11:14

使用 SS_ETCHEDHORZ 样式的静态控件/窗口(这就是资源管理器在视觉样式方面确实并且应该为您提供最准确的渲染)

Use a static control/window with the SS_ETCHEDHORZ style (This is what explorer does and should give you the most accurate rendering when it comes to Visual Styles)

献世佛 2024-09-09 14:11:14

我不认为您只是在寻找 LineTo

对于菜单和工具栏,分隔符通常是由菜单和工具栏 API 为您绘制的。对于对话框等中的随机分隔符,就像您添加的图片中一样,您可以只画一条线。

I don't suppose you're just looking for LineTo?

For menus and toolbars, generally the separators are drawn for you by the menu and toolbar APIs. For random separators in dialog boxes, etc, like in the picture you added you can just draw a line.

爱情眠于流年 2024-09-09 14:11:14

好的,您只想在表格上画直线。那是微不足道的。当绘制窗口时,即处理WM_PAINT消息时,只需绘制使用 MoveToExLineTo 函数。

OK, you just want to draw straight lines on the form. That is trivial. When drawing your window, i.e. when processing the WM_PAINT message, simply draw a line using the MoveToEx and LineTo functions.

清晨说晚安 2024-09-09 14:11:14

当您插入带有连字符“-”作为文本的普通菜单项时,您会在菜单中插入分隔符。

Windows 会自动将它们扩展为分隔符。

You insert separators in menus when you insert a normal menu item with a hyphen "-" as text.

Windows will automatically expand them to separators.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文