Opacity während Programm ausführung

  • VB.NET
  • .NET (FX) 4.5–4.8

Es gibt 2 Antworten in diesem Thema. Der letzte Beitrag () ist von Ruerte.

    Opacity während Programm ausführung

    Ich glaub ich bin mal wieder zu Dumm oder verstehe etwa nicht ganz...
    Ich möchte die Opacity während das Programm läuft verändern jedoch naja es tut sich nix!
    Weder Das Programm wird Geschlossen noch ändert sich die Durchlässigkeit :/
    Der Timer läuft auf 10msic.

    Evt. hat jemand von euch eine Idee Den Code den ich verwende:

    VB.NET-Quellcode

    1. Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
    2. Me.Opacity = i
    3. i = i - 1
    4. If i = 0 Then Application.Exit()
    5. End Sub


    Danke schon mal im voraus
    Unfortunately, this Signature is not available in Germany because it may contain music for which GEMA
    has not granted the respective music rights. Sorry about that.

    Ruerte schrieb:

    es tut sich nix!
    Ändere mal die Opacity als Double im Bereich von 0 bis 1.
    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    Programmierfragen über PN / Konversation werden ignoriert!
    @RodFromGermany

    Danke Dir, hätte ich ja lange versuchen können ^^

    Lösung:

    VB.NET-Quellcode

    1. Dim i As Double = 0.9

    VB.NET-Quellcode

    1. Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
    2. Me.Opacity = i
    3. i = i - 0.1
    4. If i = 0 Then Application.Exit()
    5. End Sub

    Unfortunately, this Signature is not available in Germany because it may contain music for which GEMA
    has not granted the respective music rights. Sorry about that.