Ver Mensaje Individual
  #1  
Antiguo 22-10-2020
Punzo Punzo is offline
Miembro
 
Registrado: abr 2006
Posts: 96
Reputación: 19
Punzo Va por buen camino
Deshabilitar sonido de notificaciones

Buen día a todos, quiero deshabilitar el sonido de las notificaciones con la propiedad EnableSound, y simplemente no lo hace, estoy pasando algo por alto?, gracias de antemano
Código Delphi [-]
procedure TMesa.OnTm1(Sender :TObject);
var
N, Hm :TTime;
D :TDateTime;
Dif :Integer;
Notificacion: TNotification;
Notc :TNotificationCenter;
begin
  Notc := TNotificationCenter.Create(Self);
  Notificacion := Notc.CreateNotification ;
  Notificacion.Name := Numero;
  Notificacion.EnableSound := False;
  if HoraM = '' then
    HoraM := Hora;
  Hm := StrToTime(LeftStr(HoraM, 2) + ':' + MidStr(HoraM, 3, 2) + ':' + RightStr(HoraM, 2));
  N := StrToTime(FormatDateTime('hh:nn:ss', Now));
  if Hm > N then 
    D := Hm - N
    else
      D := N - Hm;
  Dif := StrToInt(FormatDateTime('nn', D));
  if (Dif >= 10) and (Dif < 15) then
    begin
      TintColor := TAlphaColorRec.Yellow;
      Notificacion.EnableSound := False;
      Notificacion.AlertBody := 'La mesa ' + Trim(Numero) + ' tiene más de 10 minutos sin movimiento';
      Notc.PresentNotification(Notificacion);
      Inc(Notificacion.Number);
    end
    else if Dif >= 15 then
      begin
        TintColor := TAlphaColorRec.Red;
        Notificacion.EnableSound := False;
        Notificacion.AlertBody := 'La mesa ' + Trim(Numero) + ' tiene más de 15 minutos sin movimiento';
        Notc.PresentNotification(Notificacion);
        Inc(Notificacion.Number);
      end;
  Notificacion.DisposeOf;
  Notc.DisposeOf;
Responder Con Cita