당신은 버튼을 직접 그릴 테마 엔진을 사용할 수 있습니다 - 우선이 같은 시도 :
(엠바 카데로 포럼에 스레드
"Windows themes in combobox"에서 적응)
uses
Themes;
procedure DrawComboBoxButton(ACanvas: TCanvas; ADown, AMouseInControl: Boolean; const ARect: TRect);
var
ComboElem: TThemedComboBox;
Details: TThemedElementDetails;
begin
if ThemeServices.ThemesEnabled then
begin
if ADown then
ComboElem := tcDropDownButtonPressed
else if AMouseInControl then
ComboElem := tcDropDownButtonHot
else
ComboElem := tcDropDownButtonNormal;
Details := ThemeServices.GetElementDetails(ComboElem);
ThemeServices.DrawElement(ACanvas.Handle, Details, ARect);
end
else
begin
if ADown then
DrawFrameControl(ACanvas.Handle, ARect, DFC_SCROLL, DFCS_SCROLLCOMBOBOX or DFCS_PUSHED)
else
DrawFrameControl(ACanvas.Handle, ARect, DFC_SCROLL, DFCS_SCROLLCOMBOBOX);
end;
end;
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
DrawComboBoxButton(PaintBox1.Canvas, False, False, Bounds(0, 0, 20, 20));
DrawComboBoxButton(PaintBox1.Canvas, True, False, Bounds(20, 0, 20, 20));
end;
.
Mike Lischke의 "Windows XP Theme Explorer"은 "요소"및 "세부 정보"를 올바르게 찾을 수 있도록 도와줍니다. 그리고 this SO thread을보십시오.
나는 구글 tcDropDownButtonNormal을했고 몇몇 코드 예제를 발견했다. 불행하게도 나는 테마 엔진에 대한 지식이나 이해가 없으므로 Google에 시도하는 것은 이전의 제 3 자 엔진에 대한 참조 만 얻었습니다. 당신은 이것을 읽을만한 곳이 있습니까? –