Equivalente de delphi a c#
Abajo está el código en Delphi y me gustaría verlo en C#, se trata de un TabControl para cambiar la ficha de fondo negro y las letras rojas
procedure TForm1.PageControl1DrawTab(Control: TCustomTabControl;
TabIndex: Integer; const Rect: TRect; Active: Boolean);
var
R: TRect;
texto: String;
begin
Control.Canvas.Brush.Color := clBlack;
Control.Canvas.Font.Color := clRed;
Texto := PageControl1.Pages[TabIndex].Caption;
R := Rect;
Control.Canvas.FillRect(R);
If not Active Then
Inflaterect(R, 0, -3);
DrawText(Control.Canvas.Handle, PChar (Texto), -1, R, DT_SINGLELINE or DT_CENTER or DT_VCENTER);
end;
|