Recent

Author Topic: Is Possible change orientation of text  (Read 977 times)

eldonfsr

  • Sr. Member
  • ****
  • Posts: 446
Is Possible change orientation of text
« on: February 02, 2023, 03:11:13 am »
Hello Friend well i don't know if is possible to print text on vertical direction normal  is horizontal but i need to print a labels but the text must be Vertical because the label is large but to width, so i need change direction of text.... some help thanks...

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2010
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Is Possible change orientation of text
« Reply #1 on: February 02, 2023, 03:39:46 am »
You can do this pretty easy.
Turn in properties WordWrap to True and put a space between each character, see picture.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

Aruna

  • Full Member
  • ***
  • Posts: 119
Re: Is Possible change orientation of text
« Reply #2 on: February 02, 2023, 03:56:14 am »
Hello Friend well i don't know if is possible to print text on vertical direction normal  is horizontal but i need to print a labels but the text must be Vertical because the label is large but to width, so i need change direction of text.... some help thanks...

Please drop two Labels, a SpinEdit and a Button onto your form then use the code below. Tested on Linux.
Try a value of 900 in SpinEdit. And clicking the button should make the Label2 text vertical. Hope this helps.
Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Spin;
  9.  
  10. type
  11.  
  12.   { TForm1 }
  13.  
  14.   TForm1 = class(TForm)
  15.     Button1: TButton;
  16.     Label1: TLabel;
  17.     Label2: TLabel;
  18.     SpinEdit1: TSpinEdit;
  19.     procedure Button1Click(Sender: TObject);
  20.     procedure SpinEdit1Change(Sender: TObject);
  21.   private
  22.  
  23.   public
  24.  
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.  
  30. implementation
  31.  
  32. {$R *.lfm}
  33.  
  34. { TForm1 }
  35.  
  36. procedure TForm1.SpinEdit1Change(Sender: TObject);
  37. begin
  38.   Label1.Font.Orientation:= SpinEdit1.Value;
  39. end;
  40.  
  41. procedure TForm1.Button1Click(Sender: TObject);
  42. const LF= LineEnding; // LineFeed
  43.  
  44. //Source position: sysunixh.inc line 28
  45. // const LineEnding = #10;}
  46.  
  47. begin
  48.  
  49.   // label2.Caption:='V'#10'e'#10'r'#10't'#10'i'#10'c'#10'a'#10'l';  Try this later and comment line below.
  50.  
  51.   // Just to demonstrate multiple ways of using line feed.  
  52.   label2.Caption:='V'+LF+'e'+LF+'r'+LF+'t'+LF+'i'+LineEnding+'c'+LF+'a'#10'l';
  53.  
  54. end;
  55.  
  56. end.
  57.  
« Last Edit: February 02, 2023, 04:52:04 am by Aruna »

paweld

  • Hero Member
  • *****
  • Posts: 970
Re: Is Possible change orientation of text
« Reply #3 on: February 02, 2023, 08:04:54 am »
In the report desinger show Object Inspector -> menu: Tools > Toolbar > Object Inspector
Then you select a memo and set the Angle property (in Object Inspector) to 90
Best regards / Pozdrawiam
paweld

eldonfsr

  • Sr. Member
  • ****
  • Posts: 446
Re: Is Possible change orientation of text
« Reply #4 on: February 02, 2023, 10:49:41 pm »
Thanks for your help, I change before i put table field but send a error calculatin size of field so i change as suggest on getvalue change value and is working thanks so much..

if(ParName='Product Code') then begin
    ParValue:=DM.SQLQProds.FieldByName('pnpartnumber').AsString;
 end;

 

TinyPortal © 2005-2018