본문 바로가기

반응형
SMALL

델파이

stringgrid의 특정 셀의 색상을 변경하는 코드 procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var Grid: TStringGrid; begin Grid := Sender as TStringGrid; // Set color for cell in row 2 and column 3 if (ACol = 3) and (ARow = 2) then begin Grid.Canvas.Brush.Color := clRed; Grid.Canvas.FillRect(Rect); end; // Draw cell contents Grid.Canvas.Font := Grid.Font; Grid.Canvas.TextRect(R.. 더보기
Stringgrid의 숫자 포멧 설정 stringgrid의 셀에서 숫자의 실수형의 포멧을 지정하는 방법 procedure TForm1.StringGrid1GetEditText(Sender: TObject; ACol, ARow: Integer; var Value: string); begin // Set format for real numbers in column 2 if (ACol = 2) and TryStrToFloat(Value, Value) then Value := FormatFloat('#,##0.00', StrToFloat(Value)); end; 더보기
Stringgrid의 셀의 폰트와 정렬 Stringgrid의 셀에서 폰트와 가운데 정렬 등을 할 때 아래와 같은 코드를 사용한다. procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var S: string; Grid: TStringGrid; Font: TFont; TextWidth: Integer; begin Grid := Sender as TStringGrid; // Get cell contents S := Grid.Cells[ACol, ARow]; // Create font Font := TFont.Create; Font.Size := 12; Font.Name := 'Arial'; if AR.. 더보기
The advantages of Delphi compared to Python Delphi and Python are both popular programming languages, but they have different strengths and weaknesses. Here are some advantages of Delphi compared to Python: Performance: Delphi is a compiled language, which means that the code is compiled into machine code before execution. This results in faster and more efficient code compared to Python, which is an interpreted language. Native support f.. 더보기

반응형
LIST