Autor Beitrag
V!P3R
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151



BeitragVerfasst: Do 22.11.07 18:13 
Hi,
Ich wollte folgenden code schreiben:

ausblenden Delphi-Quelltext
1:
Label3.Font.Size:= Edit2.Text;					

das funktioniert nicht wegen:

ausblenden Delphi-Quelltext
1:
[Fehler] Unit1.pas(34): Inkompatible Typen: 'Integer' und 'TCaption'					

was muss ich ändern? Ich will das man in das EditFeld ne Zahl schreiben kann, und so groß soll der text dann werden! Label.Font.Size:=...


MfG


Zuletzt bearbeitet von V!P3R am Sa 24.11.07 15:29, insgesamt 2-mal bearbeitet
TProgger
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 148

XP
D6, D2007 prof
BeitragVerfasst: Do 22.11.07 18:15 
StrToInt(Edit.Text)

_________________
Wir haben für jede Lösung das richtige Problem ;)
gispos
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 94

WIN 7
XE10, D2007
BeitragVerfasst: Do 22.11.07 22:46 
Besser: Label3.Font.Size:= StrToIntDef(Edit2.Text, Label3.Font.Size);
Gibt im falle dass kein gültiger Integer Wert eingegeben wird, Label3.Font.Size zurück.

Gruß gispos

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
V!P3R Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151



BeitragVerfasst: Sa 24.11.07 00:33 
Titel: noch ein "inkompatibles" Problem
hi, hab noch ein "inkompatibles" Problem.

ausblenden Delphi-Quelltext
1:
Label1.Font.Style:=fsBold;					


ausblenden Delphi-Quelltext
1:
[Fehler] Unit1.pas(35): Inkompatible Typen: 'TFontStyles' und 'TFontStyle'					




wie kann man per button klick etwas fsBold (also fett ) machen??



MfG
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 24.11.07 08:05 
ausblenden Delphi-Quelltext
1:
Label1.Font.Style:=[fsBold];					

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
V!P3R Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151



BeitragVerfasst: Sa 24.11.07 13:33 
so weit, so gut...

aber wenn ich jetzt eine
CheckBox nehmen will
sodass man sagen kann: es soll fett und kursiv sein, es soll durchgestrichen und unterstrichen sein usw, also dass man per Checkbox wählen kann was man haben möchte, und was nicht.
"fsBold" und die anderen sind ja EIGENTLICH Boolean, aber darauf kann man irgentwie nicht zugreifen
(ich habs versucht mit Label1.Font.Style.fsBold:=True; aber das geht nicht)

Kann man auf diesen Boolean irgentwie zugreifen, oder gibts noch ne ganz andere möglichkeit??


MfG
Xion
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
EE-Maler
Beiträge: 1952
Erhaltene Danke: 128

Windows XP
Delphi (2005, SmartInspect), SQL, Lua, Java (Eclipse), C++ (Visual Studio 2010, Qt Creator), Python (Blender), Prolog (SWIProlog), Haskell (ghci)
BeitragVerfasst: Sa 24.11.07 13:59 
ja, so:
ausblenden Delphi-Quelltext
1:
2:
Label1.Font.Style:=[fsBold,fsItalic];
Label1.Font.Style:=Label1.Font.Style-fsItalic;

_________________
a broken heart is like a broken window - it'll never heal
In einem gut regierten Land ist Armut eine Schande, in einem schlecht regierten Reichtum. (Konfuzius)
V!P3R Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151



BeitragVerfasst: Sa 24.11.07 15:27 
Titel: danke
Danke, dass "+" bzw das "-" war das, was mir gefehlt hat, jetz gehts.

aber leider hab ich schon wieder ne neue frage und zwar:


wie kann ich in meine Form ein ComboBox mit allen schriftarten machen, die ich habe (soll sich auf jeden Computer anpassen.


MfG
gispos
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 94

WIN 7
XE10, D2007
BeitragVerfasst: Sa 24.11.07 19:06 
Nimm doch einfach einen TFontDialog.

gruß gispos
V!P3R Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151



BeitragVerfasst: Sa 24.11.07 22:04 
und wo/was ist das?
Atreyu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 137


Delphi 7 Enterprise
BeitragVerfasst: Sa 24.11.07 22:15 
Dieser STandard-Dialog, den Windows dir serviert, wenn du zB im Object Manager auf eine Font-Property Doppelklickst.
V!P3R Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151



BeitragVerfasst: Sa 24.11.07 22:18 
so weit, so gut, und wie kann ich auf ihhn zu greifen.

(bzw. steht der in einem der reiter (stadard, zusätzlich,usw...), wenn ja IN WELCHEM)


MfG


Edit: Hab ihn gefunden, aber wo stellt man ein das er mir die schriftarten liefern soll?
V!P3R Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151



BeitragVerfasst: Sa 24.11.07 23:10 
ich habs mir jez (glaub ich ) kompliziert gemacht, ich hab ein TWordFont benutzt, und eine TComboBox


MfG


Zuletzt bearbeitet von V!P3R am Sa 24.11.07 23:34, insgesamt 1-mal bearbeitet
V!P3R Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 151



BeitragVerfasst: Sa 24.11.07 23:34 
Ma ne ganz andere frage. Wie kann mann delphi sagen, das er nur das formatieren soll, was auch markiert ist??

imoment formatiert delphi den ganzen text.


MfG
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 24.11.07 23:51 
user profile iconV!P3R hat folgendes geschrieben:
Ma ne ganz andere frage. Wie kann mann delphi sagen, das er nur das formatieren soll, was auch markiert ist??

imoment formatiert delphi den ganzen text.


MfG

Indem man sich mit Grundlagen von Delphi beschäftigt.
:wink:

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: So 25.11.07 00:48 
Moin!

Ich denke, deine letzte Frage führt nun wirklich zu weit vom Thema dieses Threads weg. ;) Bitte erstelle für eine neue Frage auch ein separates Topic, da die Diskussion mehrerer Fragen in einem Topic für gewöhnlich für Verwirrung und Durcheinander sorgt. Daher:

*geschlossen*


cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Dieses Thema ist gesperrt, Du kannst keine Beiträge editieren oder beantworten.

Das Thema wurde von einem Team-Mitglied geschlossen. Wenn du mit der Schließung des Themas nicht einverstanden bist, kontaktiere bitte das Team.