Autor Beitrag
stark
Hält's aus hier
Beiträge: 3


Borland Developerstudio Pro 2006
BeitragVerfasst: Fr 13.06.08 12:00 
Hallo,

ich versuche in einem TRichEdit-Feld chemische Formeln eingeben zu können wie H2O, die 2 soll aber tiefgestellt werden. Wie geht das? Beim Fontdialog finde ich nix. Ich arbeite mit Borland Developer Studie 2006 mit Delphi WIN32.


Moderiert von user profile iconNarses: Topic aus Sonstiges (Delphi) verschoben am Fr 13.06.2008 um 12:23
GericasS
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 540

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Fr 13.06.08 12:46 
Ich denke mal nicht dass du da mit in einer standart Unit weit kommen wirst. Brauchst wahrscheinlich ein spezielle Maths Unit für solch eine Aufgabe =)


LG

GericasS

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300
iKilledKenny
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 8

Win XP
D5 Prof, C# Express 2005
BeitragVerfasst: Fr 13.06.08 13:10 
So ähnlich habe ich das in einer Routine, die einem Button-Click für SubScript zugewiesen ist. Funktioniert auf jeden Fall über das CharFormat und ein SendMessage.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure SetSubScript (Value: Boolean);

var   Format: TCharFormat2;
      Flag:   Longint;

begin
  FillChar(Format, SizeOf(TCharFormat2), 0);
  Format.cbSize := SizeOf(TCharFormat2);
  with Format do
    begin
      dwMask := CFM_SUBSCRIPT;
      if Value then
        dwEffects := dwEffects or CFE_SUBSCRIPT;
    end;
  SendMessage(RichEdit.Handle, EM_SETCHARFORMAT, SCF_SELECTION, LPARAM(@Format));
end;
stark Threadstarter
Hält's aus hier
Beiträge: 3


Borland Developerstudio Pro 2006
BeitragVerfasst: Fr 13.06.08 19:43 
Titel: TCharFormat2?
Hallo,

also der Source läuft bei mir nicht, da mein Delphi "TCharFormat2" nicht kennt. Trotzdem danke für die Nachricht.

Gruß

Alexander Stark
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: Fr 13.06.08 20:24 
Für TCharFormat2 musst du die Unit RichEdit bei uses hinzufügen.