简体   繁体   English

如何创建垂直线?

[英]How to create a vertical line?

I want to place a vertical line on my Window like the following: 我想在我的窗口上放置一条垂直线,如下所示:

在此处输入图片说明

I have tried to create a "STATIC" control with the SS_SUNKEN style and with a width of 2 : 我试图用SS_SUNKEN样式创建宽度为2"STATIC"控件:

CreateWindowEx(NULL, "STATIC", "", WS_CHILD | WS_VISIBLE | SS_SUNKEN, 10, 10, 2, 200, hParentWindow, NULL, GetModuleHandle(NULL), NULL);

It had worked, but I am wondering if this is the correct way of doing it? 它奏效了,但我想知道这是否是正确的方法?

如果您想自己绘制,也可以使用DrawEdge函数。

An alternative to using a Static control is to render the sunken border yourself. 使用静态控件的一种替代方法是自己渲染凹陷的边框。

If no theme is applied, use DrawEdge . 如果未应用主题,请使用DrawEdge

If a theme is applied to the window, call DrawThemeBackground passing GP_LINEVERT for iPartId . 如果一个主题应用到窗口,调用DrawThemeBackground传递GP_LINEVERTiPartId。 See Parts and States for additional information on theme rendering. 有关主题渲染的更多信息,请参见零件和状态

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM