if anweisung

  • VB.NET

Es gibt 2 Antworten in diesem Thema. Der letzte Beitrag () ist von [WCC] Yunses.

    if anweisung

    hi

    hab ne einfache if anweisung aber iwie funktioniert das nich (des soll so ne art diashow werden die immerwieder von neu anfängt form 3-6 sind offen und alle auf Opacity = 0)


    VB.NET-Quellcode

    1. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    2. If Form3.Opacity = 0 And Form4.Opacity = 0 And Form5.Opacity = 0 And Form6.Opacity = 0 Then
    3. Form3.Opacity = 100
    4. ElseIf Form3.Opacity = 100 And Form4.Opacity = 0 And Form5.Opacity = 0 And Form6.Opacity = 0 Then
    5. Form3.Opacity = 0
    6. Form4.Opacity = 100
    7. ElseIf Form3.Opacity = 0 And Form4.Opacity = 100 And Form5.Opacity = 0 And Form6.Opacity = 0 Then
    8. Form4.Opacity = 0
    9. Form5.Opacity = 100
    10. ElseIf Form3.Opacity = 0 And Form4.Opacity = 0 And Form5.Opacity = 100 And Form6.Opacity = 0 Then
    11. Form5.Opacity = 0
    12. Form6.Opacity = 100
    13. ElseIf Form3.Opacity = 0 And Form4.Opacity = 0 And Form5.Opacity = 0 And Form6.Opacity = 100 Then
    14. Form6.Opacity = 0
    15. Form3.Opacity = 100
    16. End If
    Hallo Psychorunner,

    das mit Opacity ist wie in Mathe und Phsyik. Wenn du z.B. den Wirkungsgrad in Physik von einem Kraftwerk ausrechnest, rechnest du "die Leistung die du am Schluss bekommst" (geteilt) "die Leistung die aufgewendet wird". Als Ergebnis erhälst du einen Wert von <0 - 1. Wenn wir vom Ergebnis 0,65 ausgehen, hat das Kraftwerk den Wirkungsgrad von 65% (0,65 = 65%).

    Genau das gleiche ist bei der Windows Form Opacity, du hast einen Bereich von <0 - 1, der umgerechnet deine Prozent angibt.

    Ich hoffe ich konnte dir das Prinzip mit diesem Beispiel veranschaulichen.

    Mfg
    [WCC] Yunses