이것은 BidiMode
을 지원하고 크기를 조정하는 가장 좋은 방법입니다. 이 문제를 해결 콤보 상자의 변화를 가져
TTestComboBox=class(TComboBox)
protected
procedure WMPaint(var Msg: TMessage); message WM_Paint;
End;
Procedure TTestComboBox.WMPaint(var Msg: TMessage);
var MCanvas: TControlCanvas;
R: TRect;
Begin
inherited;
MCanvas:=TControlCanvas.Create;
Try
MCanvas.Control:=Self;
With MCanvas do begin
R:=ClientRect;
Brush.Style:= bsClear;
Pen.Color:= Color;
Pen.Width:= 3;
if BiDiMode in [bdRightToLeft, bdRightToLeftNoAlign] then begin
if Style = csSimple then //remove border and space
Rectangle(1, 1, R.Width - 1, R.Height-1) else Rectangle(-1, 1, R.Width, R.Height-1);
if Style in [csDropDown, csOwnerDrawFixed, csOwnerDrawVariable] then begin
Pen.Width:= 5; //remove space btw editor and button
MoveTo(18, 0);
LineTo(18, R.Height-1);
end;
end else begin
if Style = csSimple then
Rectangle(1, 1, r.Width - 1, R.Height-1) else Rectangle(1, 1, r.Width + 1, R.Height-1);
if Style in [csDropDown, csOwnerDrawFixed, csOwnerDrawVariable] then begin
Pen.Width:= 5;
MoveTo(R.Width - 18, 0);
LineTo(R.Width - 18, R.Height-1);
end;
end;
end;
finally
MCanvas.Free;
End;
End;
다른 구성 요소 패키지를하지만 우리는 bkFlat'에 콤보 상자의 BevelKind 속성을 설정하십시오 – PSyLoCKe
그 TEdits처럼 검은 색으로 테두리 색상을 설정할 수 없습니다 : 클라이언트 색상으로 국경을 채울 수 있습니다 '. – RRUZ