Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

TTimer in eigener Klasse verwenden

Empfohlene Antworten

Veröffentlicht

Hallo

Ich hab Testweise mir eine eigene Klasse/Objekt erstellt das abgeleitet ist

von einem Label

.H


class Label : public TLabel

{

  private:


  protected:


	AnsiString FText;

	int FNummer;

	bool FBlinken;

	TTimer *Timer;

	bool FVertikal;

	TColor FFront;


  public:

	__fastcall virtual Label::Label(Classes::TComponent* AOwner);

	__fastcall virtual Label::~Label(void);


	void __fastcall Label::SetVertikal(bool Value);


	__property bool Vertical  = {read = FVertikal, write=SetVertikal};

	__property TColor Front  = {read = FFront};


	void __fastcall Label::LabelInitialisieren(

									int Nummer,

									bool Vertikal,

									AnsiString txt,

									TColor Front

									);


	void __fastcall Label::Blinken(bool bli);


};

#endif

//---------------------------------------------------------------------

und es geht um die Funktion ::Blinken. ich will praktisch , das wenn dieser werd true ist ein Timer intialisiert wird und dann das Label jede Sekunde sichtbar/unsichtbar macht .cpp

void __fastcall Label::Blinken(bool bli)

{

  TTimer *Zeit;

  Zeit = new TTimer(this);

  Zeit->Interval = 1000;

  if (bli)

  {

	Zeit->Enabled = false;


	Zeit->OnTimer ;//= Ontime();

	if (Visible == true)

	  Visible = false;

		//Sleep(1000);

	if (Visible == false)

	 Visible = true;


  }

  else

	Zeit->Enabled = true;

}

das ist das was ich habe und Nicht korrekt ist.

Ist dieser Ansatz überhaupt richtig?

wenn ja wie mache ich das mit dem OnTime ereignis korrekt?

Danke Alex

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.