gpt4 book ai didi

delphi - 如何拥有绘制弹出菜单项复选标记

转载 作者:行者123 更新时间:2023-12-03 01:03:57 24 4
gpt4 key购买 nike

如何在 PopupMenuItem 上绘制复选标记?

我尝试过这个:

var
iLeftPos: Integer;
iTopPos: Integer;
iText: string;
iState: integer;
iGlyphRect: TRect;
begin
iTopPos := ARect.Top + (ARect.Bottom - ARect.Top -
ACanvas.TextHeight('W')) div 2;

{ Draw checkmark }
iGlyphRect := Rect(0, iTopPos, 20, iTopPos + 20);
if Touch2.Checked then
begin
iState := iState or DFCS_MENUCHECK;
DrawFrameControl(ACanvas.handle, iGlyphRect, DFC_POPUPMENU, iState);
end;
end;

但是它画出了这个: enter image description here

最佳答案

这解决了问题。谢谢TLama。

if Touch2.Checked then
begin
iState := iState or DFCS_MENUCHECK;
DrawFrameControl(ACanvas.handle, iGlyphRect, DFC_MENU, iState);
end;

enter image description here

关于delphi - 如何拥有绘制弹出菜单项复选标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19255596/

24 4 0