Autor Beitrag
koller1
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 216

WIN XP
D7 Ent
BeitragVerfasst: So 05.06.05 11:30 
Hallo!

Ich habe ein Problem. Ich versuche ein Quiz zu programmieren, wo eine Hintergrundmusik läuft. Aber, wenn man auf die Frage und die Antworten mit der Maus geht, soll die Hintergrundmusik eine Pause machen und nur Frage/Antwort vorgelesen werden! Ich habe das jetzt so probiert:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
mediaplayer3.Pause;
mediaplayer4.open;
mediaplayer4.play;
end;
(Wenn Maus auf Panel ist)

procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
mediaplayer4.Stop;
mediaplayer3.play;
end;
(Wenn Maus vom Panel runter)


Aber das funktioniert nicht richtig, da Mediaplayer4 nicht mit spielen aufhört!
Habe ich falsche procedures genommen? Oder wie realisiere ich meine Wünsche richtig???

MFG
koller1

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: So 05.06.05 11:43 
Du benötigst eine Rückmeldung, dass die Maus dein Panel verlassen, bzw. es auf dieses gekommen ist. Dazu gibt es so Messages, ich glaube die heißen CMMOUSELEAVE und CMMOUSEENTER, oder so. Hier wären die anderen gefordert.... :arrow: :idea:

_________________
Programmers never die, they just GOSUB without RETURN
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: So 05.06.05 12:58 
An dieser Stelle kram ich mal wieder meinen schon etwas angestaubten Code raus:
www.delphi-forum.de/....php?p=151441#151441

Ist zwar für TAnimate, aber für TPanel gehts genauso ;)

Gruß,
raziel

_________________
JSXGraph