Autor Beitrag
Gosa
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 112



BeitragVerfasst: Di 24.02.04 16:45 
Wie kann ich den cursor in einem laufenden Delphi Program ändern? Ich habe ein image auf meiner Form und hätte es gerne so das wenn man darauf klickt der Cursor so wie das bild aussieht.

Danke schonmal im vorraus.
Sven
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 314


D6 Ent, K3 Pro (patched)
BeitragVerfasst: Do 26.02.04 07:48 
z.B.
ausblenden Delphi-Quelltext
1:
Screen.Cursor := crArrow					

oder
ausblenden Delphi-Quelltext
1:
Form1.Cursor := crArrow					

oder
ausblenden Delphi-Quelltext
1:
IrgendeinButton.Cursor := crArrow					


Wie Du aus einem Image ein Cursor machst, kann ich dir allerdings auch nicht sagen.

_________________
MDK 9.1, Kernel 2.4.21, KDE 3.1 Kylix 3 Pro (patched), nutze aber auch Windows
MaxiTB
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 679

Win2000, WinXp, Workbench ;-)
D7 Ent, VS2003 Arch.
BeitragVerfasst: Do 26.02.04 08:05 
Tip für die Vorgangsweise Image > Icon:

Am besten die Image Datein ins CUR-Format konvertieren und dann den Cursor laden.

Das laden ist ja einfach über die Property Cursor, aber das konvertieren - da bin ich gerade überfragt. Besonders da Cursors meines Wissens noch nicht High/True Color sind sondern max. 256 Farben haben können.

Besser ists da wie der Explorer es z.B. beim Drag&Drop macht. Da wird einfach an Cursorposition ein Window gehängt und ein Image reingeschrieben (MouseCapturing).

_________________
Euer Mäxchen
Wer früher stirbt, ist länger tot.
Gosa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 112



BeitragVerfasst: Fr 27.02.04 02:40 
Hehe ok dann mach ich das so danke!
Gosa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 112



BeitragVerfasst: Di 02.03.04 15:02 
Ich habe jetzt einfach in dem Delphi editor ein cursor gemalt der wie ein Hutschen aussieht das andere funkitioniert nicht so gut. Aber wie kriege ich den jetzt den cursor ins programm? So ungefähr hätte ich das gerne:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
 procedure TFHockeyTraining.FormCreate(Sender: TObject);
Begin
   FHockeyTraining.cursor := 'C:\...\crHuetchen.cur';
End;



Das geht aber nicht.

Danke schonmal im voraus.

Moderiert von user profile iconDeCodeGuru: Delphi-Tags hinzugefügt
Gosa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 112



BeitragVerfasst: Di 02.03.04 15:30 
Habs gerade zufällig selbst hier im Forum gefunden.... hab eingentlich was ganz anderes gesucht. :D

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.FormCreate(Sender: TObject); 
 const 
  MyCurs = 12345; 
    begin 
         Screen.Cursors[MyCurs]:=LoadCursorFromFile('c:\Cursors\MyCursor.ani'); 
         Screen.Cursor := MyCurs; 
end;


Moderiert von user profile iconDeCodeGuru: Und nochemal :wink: