Einzelne Button klicks

    • Einzelne Button klicks

      [COLOR="DarkOrange"]Hi ich wolte mal fragen :
      wie ich es einstelle das ich mit mehrfachen button klick verschiedene
      aktionen auslöse =)
      also zum beispiel :[/COLOR]


      Quellcode

      1. [COLOR="Lime"][B]Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      2. MsgBox("TEST")
      3. End Sub[/B][/COLOR]


      [COLOR="DarkOrange"]jetzt habe ich ja wenn ich button 1 klicke kommt msgbox
      ich will , wenn ich button 1 klicke da mehrer aktion kommen also

      1. klick - msgbox("test")
      2. klick - form2.show

      nur so als beispiel ^^ vllt kann mir a jemand helfen[/COLOR]
    • Werbung zur Unterstützung des Forums ( Bitte AddBlocker deaktivieren )

    • Skycro;68396 schrieb:

      wenste doppelklick meinst muste des doubleclick event nehmen

      sonst könntest z.B.:

      Quellcode

      1. Dim a As Integer = 1
      2. If a = 1 then 'wenn a 1 ist befehl 1
      3. Msg("blub")
      4. a = 2
      5. Else if a = 2 then 'wenn a 2 ist Befehl 2
      6. Form2.show
      7. a =1
      8. End if
      Alles anzeigen


      is eine Moglichkeit


      [COLOR="DarkOrange"]danke ersmal^^
      ich such kein doppelklick ich will 1 buttn für mehere funktionen nutzen
      also nochn beispiel [/COLOR]


      Quellcode

      1. [COLOR="Lime"][B]Button1 erste mal klicken = MsgBox("10")
      2. Button1 zweite mal klicken = MsgBox("9")
      3. Button1 dritte mal klicken = MsgBox("8")
      4. Button1 vierte mal klicken = MsgBox("7")
      5. Button1 fünfte mal klicken = MsgBox("6")
      6. Button1 sechste mal klicken = MsgBox("5")
      7. Button1 siebte mal klicken = MsgBox("4")
      8. Button1 achte mal klicken = MsgBox("3")
      9. Button1 neunte mal klicken = MsgBox("2")
      10. Button1 zehnte mal klicken = MsgBox("1")[/B][/COLOR]


      [COLOR="#ff8c00"]also das beispiel sollte jetzt 1 countdown mit einem button sein [/COLOR]
    • Hätte eine Idee:

      Du kannst auf deine Form mehrere Buttons übereinander legen ö.ö
      Ist etwas umständlich aber was anderes fällt mir momentan nicht ein:

      wie gesagt umständlich aber funktioniert ^^
      Musst die Buttons ebend exakt übereinander legen

      - alle Buttons auser den 1. vorher auf Unsichtbar einstellen
      Edit: Hier mal ein beispiel : Download

      Hab 7 button übereinander.


      MFG
    • Wenne dir platz erspaaren willst
      kannste das doch so machen
      du machst dirs so jetzt ohne code beschrieben^^
      [COLOR="DeepSkyBlue"]<[/COLOR] [COLOR="Green"]Button[/COLOR] [COLOR="DarkOrchid"]>[/COLOR]

      [COLOR="Green"]Grün= Der button auf den du klickst[/COLOR]

      [COLOR="DarkOrchid"]Vorwärts - also du klicks drauf und der Button z.B. Settings wird jetzt zu Abut[/COLOR]

      [COLOR="DeepSkyBlue"]Zurück - Also du drücks drauf und dan wird aus About Settings -Ist 1 Klick mehr als du willst aber ich find das gut so^^[/COLOR]


      -So jetzt die frage geht das so?
    • Quellcode

      1. Public Class Form1
      2. Public counter As Integer
      3. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      4. counter = counter + 1
      5. If counter = 1 Then
      6. MsgBox("1", MsgBoxStyle.OkOnly)
      7. End If
      8. If counter = 2 Then
      9. MsgBox("2", MsgBoxStyle.OkOnly)
      10. End If
      11. If counter = 3 Then
      12. MsgBox("3", MsgBoxStyle.OkOnly)
      13. End If
      14. If counter = 4 Then
      15. MsgBox("4", MsgBoxStyle.OkOnly)
      16. End If
      17. If counter = 5 Then
      18. MsgBox("5", MsgBoxStyle.OkOnly)
      19. End If
      20. If counter = 6 Then
      21. MsgBox("6", MsgBoxStyle.OkOnly)
      22. End If
      23. If counter = 7 Then
      24. MsgBox("7", MsgBoxStyle.OkOnly)
      25. End If
      26. End Sub
      27. End Class
      Alles anzeigen


      LG
    • HEaRiX;68694 schrieb:

      Quellcode

      1. Public Class Form1
      2. Public counter As Integer
      3. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      4. counter = counter + 1
      5. If counter = 1 Then
      6. MsgBox("1", MsgBoxStyle.OkOnly)
      7. End If
      8. If counter = 2 Then
      9. MsgBox("2", MsgBoxStyle.OkOnly)
      10. End If
      11. If counter = 3 Then
      12. MsgBox("3", MsgBoxStyle.OkOnly)
      13. End If
      14. If counter = 4 Then
      15. MsgBox("4", MsgBoxStyle.OkOnly)
      16. End If
      17. If counter = 5 Then
      18. MsgBox("5", MsgBoxStyle.OkOnly)
      19. End If
      20. If counter = 6 Then
      21. MsgBox("6", MsgBoxStyle.OkOnly)
      22. End If
      23. If counter = 7 Then
      24. MsgBox("7", MsgBoxStyle.OkOnly)
      25. End If
      26. End Sub
      27. End Class
      Alles anzeigen


      LG


      Ja geht über mehrere wege.
      Meiner war jetzt auf die schnelle, doch mein Code ist sogar kürzer, allerdings braucht er bisschem mehr performance (aber was macht so ein Invisible/Visible schon aus :D)

      MFG