Tipp 0005 Laufschrift in der Titelleiste
Autor/Einsender:
Datum:
  Detlev Schubert
08.01.2001
Entwicklungsumgebung:   VB 5
Sicherlich ist es schon recht interessant, eine nicht ganz alltägliche Beschriftung in der Titelleiste einer Form zu haben. Somit kann man für bestimmte Dinge die Aufmerksamkeit des Anwenders auf diese Form lenken.
Mit der API-Funktion LockWindowUpdate unter Zuhilfenahme eines Timers zur Steuerung der Geschwindigkeit ist dies recht einfach zu verwirklichen.
 
Option Explicit

Private sFormularCaption As String

Private Declare Function LockWindowUpdate Lib "User32" (ByVal _
      hWndLock As Long) As Long

Private Sub Form_Load()
  Me.Caption = "Dies ist eine Laufschrift-Demo" & _
        String$(10, " ")
  sFormularCaption = Me.Caption
End Sub

Private Sub Command1_Click(Index As Integer)
  Select Case Index
    Case 1, 2
      Command1(2).Visible = Command1(2).Visible Xor -1
      Command1(1).Visible = Command1(1).Visible Xor -1
      Timer1.Enabled = Timer1.Enabled Xor -1
    Case Else
      Unload Me
      End
  End Select
End Sub

Private Sub Timer1_Timer()
  Static Zaehler As Long

  Zaehler = (Zaehler + 1) Mod Len(sFormularCaption)
  LockWindowUpdate Me.hWnd
  Me.Caption = Left(sFormularCaption, Zaehler)
  LockWindowUpdate 0
End Sub
 
Weitere Links zum Thema
Laufschrift
Titelleiste blinken lassen

Windows-Version
95
98/SE
ME
NT
2000
XP
Vista
Win 7
VB-Version
VBA 5
VBA 6
VB 4/16
VB 4/32
VB 5
VB 6


Download  (2,1 kB) Downloads bisher: [ 3521 ]

Vorheriger Tipp Zum Seitenanfang Nächster Tipp

Startseite | Projekte | Tutorials | API-Referenz | VB-/VBA-Tipps | Komponenten | Bücherecke | VB/VBA-Forum | VB.Net-Forum | DirectX-Forum | Foren-Archiv | DirectX | VB.Net-Tipps | Chat | Spielplatz | Links | Suchen | Stichwortverzeichnis | Feedback | Impressum

Seite empfehlen Bug-Report
Letzte Aktualisierung: Sonntag, 26. Juni 2011