1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram

  5. Delphifan Magazine
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

Font size problem in tstringgrid on a android.

Discussion in 'Delphi Help&Requests' started by croc, Nov 7, 2014.

  1. croc
    Offline

    croc DF Member

    Hello,

    Can somebody help me to resolve this problem.

    I have application that get data from a sql server and place the information in a tstringgrid.

    When I compiled application for windows the font size is fine but when I compile the same for a android application the text is to large also the each cell length is to small.

    Do somebody know how to resolve this???
     
  2. breakenter
    Online

    breakenter Guest

    tri this
    Code:
    procedure TForm1.FormCreate(Sender: TObject);
    var
      Col, Row: Integer;
      CellCtrl: TStyledControl;
    begin
    StringGrid1.Cells[0,0]:='Init'                                 ;
    StringGrid1.Cells[1,0]:='Init'                                 ;
    StringGrid1.Cells[2,0]:='Init'                                 ;
    StringGrid1.Cells[3,0]:='Init'                                 ; //set any text
    
    // SET FONT to STRINGGRID
    for Col:= 0 to StringGrid1.ColumnCount - 1 do
      begin
        for Row:= 0 to StringGrid1.RowCount - 1 do
        begin
          CellCtrl:= TColumnAccess(StringGrid1.Columns[Col]).CellControlByRow(Row);
          if (CellCtrl <> nil ) and (CellCtrl is TTextCell) then
          begin
            TTextCell(CellCtrl).StyledSettings:= []              ;
            TTextCell(CellCtrl).FontColor:= clawhite             ;
            TTextCell(CellCtrl).Font.Family:= 'Times New Roman'  ;
            TTextCell(CellCtrl).Font.Style:=[TFontStyle.fsBold]  ;
            TTextCell(CellCtrl).Font.Size:= 26                   ;
         end;
        end;
      end;
    StringGrid1.Cells[0,0]:=''                                     ;
    StringGrid1.Cells[1,0]:=''                                     ;
    StringGrid1.Cells[2,0]:=''                                     ;
    StringGrid1.Cells[3,0]:=''                                     ;
    end;
     

Share This Page