Jump to content


Photo

TNxAlertWindow Closing.


  • Please log in to reply
1 reply to this topic

#1 Speed

Speed

    Senior Member

  • Members
  • PipPip
  • 211 posts
  • Gender:Male

Posted 23 May 2025 - 03:30 AM

Hi Boki,

 

I mainly using NextSuite 6 but I like the TNxAlertWindow from NextSuite 5 for some things.

 

I have a couple of event handlers in an application that show when a connection to a server application has been lost, and when it reconnects.

 

What I'm trying to do is, if the disconnection alert is still showing when a connection is reestablished, it will be closed and the re-connection alert shown instead.

 

However, it doesn't seem to work.  The code is below.

 

= Steve

procedure TfrmMain.ConnectionLost(Sender: TObject);
begin
   LostConnectionNotification.CloseDelay := 5000;
   LostConnectionNotification.Popup;
end;

// ****************************** TfrmMain.ConnectionReEstablished **************************************************
procedure TfrmMain.ConnectionReEstablished(Sender: TObject);
begin
   if LostConnectionNotification.Showing then
   begin
      LostConnectionNotification.Close;
   end;

   ReconnectionNotification.CloseDelay := 5000;
   ReconnectionNotification.Popup;
end;

 


 

 



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,249 posts
  • Gender:Male

Posted 23 May 2025 - 05:06 PM

Hello,

 

Close method should do the thing. Maybe you can send me a minimal demo project so I can test it. Not sure if maybe 2 alert windows are having some kind of conflict.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users