Avatar billede eben Nybegynder
14. november 2002 - 20:15 Der er 6 kommentarer og
1 løsning

Pitch

Er der nogen der ved hvordan man bruger Textattributes.Pitch, koden bliver compileret uden fejl men Pitch har ingen virkning


procedure TForm1.Open(const AFileName: string);
begin

  PathName := AFileName;
  Caption := AFileName;
  RichEdit1.DefAttributes.Pitch:=fpFixed;
  RichEdit1.DefAttributes.Color := clBlue;
  RichEdit1.DefAttributes.Style := [fsBold];
  with RichEdit1 do
  begin
    Lines.LoadFromFile(PathName);
    SelStart := 0;
    Modified := False;
  end;
end;
Avatar billede hermandsen Juniormester
15. november 2002 - 10:19 #1
Specifies whether the characters in the font all have the same width.

type TFontPitch = (fpDefault, fpVariable, fpFixed);
property Pitch: TFontPitch;


Description

Each typeface has an associated pitch. The characters in fixed-pitch fonts are all the same width. The characters in variable-pitch fonts differ in width. Fixed pitch fonts are generally used for representing source code, because they allow the indentation to line up properly. Variable pitch fonts are generally used to give text a more natural appearance.

Here are the possible values for Pitch:

Value    Meaning

fpDefault    The font pitch is set to the default value, which depends on the font specified in the Name property.
fpFixed        The font pitch is set to fixed. All characters in the font have the same width.
fpVariable    The font pitch is set to variable. The characters in the font have different widths.

Note:    Setting the Pitch of a fixed-pitch font to fpVariable or a variable-pitch font to fpFixed will cause Windows to find what it considers the best match to all of the font characteristics that have been specified. This might have no effect on the appearance of a font, or might cause Windows to substitute a different font with the appropriate pitch. For example, setting the pitch of MS Serif (a variable-pitch font) to fpFixed causes Courier to be displayed.
Avatar billede hermandsen Juniormester
15. november 2002 - 10:20 #2
Læs i hjælpen! ;)
Avatar billede eben Nybegynder
15. november 2002 - 11:06 #3
Har prøvet, gi'r fejl. Har lagt de to linier oppe i type erklæringen. Jeg ved ikke meget om typer og properties. Hvor skal de to linier ligge??? Og skal der flere parameter på ??
Avatar billede hermandsen Juniormester
15. november 2002 - 11:20 #4
Hvad er fejlen? Prøv:
  RichEdit1.DefAttributes.Pitch := [fpFixed];
Avatar billede eben Nybegynder
15. november 2002 - 12:41 #5
Programmet kan slet ikke compileres med type og properties erklæringen.
Har løst problemet ved at sætte Fonttypen i RichEdit'en til Courier New, opdagede lige at man kunne det.
Men tak for hjælpen
Avatar billede hermandsen Juniormester
15. november 2002 - 12:47 #6
Okay! :)
Læg selv et svar og accepter det... Så er spørgsmålet lukket! ;)
Avatar billede eben Nybegynder
15. november 2002 - 14:47 #7
-
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester