Autor Beitrag
Berki
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Sa 01.02.03 20:21 
Hi!

Ich habe folgendes Problem:
Ich habe einen String s1:='Button1' zum Bsp. Jetzt hab ich die Varialbe Bild den Typ TImage zugewiesen. Jetzt möchht ich aber der Variable Bild den String zuweisen, also Bild:=s1; nur funktioniert des net, weil string und TImage net kompatibel sind.

Wer kann mir helfen?

Größten Dank im voraus!!
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Sa 01.02.03 20:23 
Willst du ein bild mit dem text erstellen, oder was willst du machen?
Gruß
Ken
Berki Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Sa 01.02.03 20:27 
Hallo!

ernstmal danke für die schnelle antwort!

Das Bild Image1 erstellt. Dann habe ich eine Variable vom Typ TImage vereinbart. und dieser Variable möchte ich jetzt Image1 zuweisen. Nur hab ich den Namen als String. Also nicht
Bild:=Image1;
sondern
Bild:=String1; //String1='Image1';

Hoffe mir kann wer helfen.
Berki Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Sa 01.02.03 20:36 
Hi nochmal!

Ich will einfach einen String in einen Komponentennamen unwandeln!

mfg Berki
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Sa 01.02.03 20:42 
meinst du so??

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
s:='image1';
with timage(findcomponent(s)) do
begin
canvas.moveto(0,0);
canvas.lineto(100,100);
end;


so solte es gehen...

Fiji-Fighter
Berki Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Sa 01.02.03 21:09 
Titel: THX
Hallo!

Danke, ihr habt mir sehr geholfen!