Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Button Style (Pressed & Not Pressed)

Button Style (Pressed & Not Pressed)

Scheduled Pinned Locked Moved Visual Basic
question
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Midnight Ahri
    wrote on last edited by
    #1

    i would love to change windows button to keep pressed when i press it and back to the normal state when pressed again. does windows button support dat? :sigh:

    J A M 3 Replies Last reply
    0
    • M Midnight Ahri

      i would love to change windows button to keep pressed when i press it and back to the normal state when pressed again. does windows button support dat? :sigh:

      J Offline
      J Offline
      JohnPayton
      wrote on last edited by
      #2

      You could use the FlatStyle options, Unpressed is Standard, Pressed I believe if represented as Flat.

      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      If Button1.FlatStyle = FlatStyle.Flat Then
      Button1.FlatStyle = FlatStyle.Standard
      'Change The Appearance Back To UnPressed
      Else
      Button1.FlatStyle = FlatStyle.Flat
      'Go And Do Whatever And Look Like The Button Is Pressed
      End If
      End Sub

      Hope this helps :)

      1 Reply Last reply
      0
      • M Midnight Ahri

        i would love to change windows button to keep pressed when i press it and back to the normal state when pressed again. does windows button support dat? :sigh:

        A Offline
        A Offline
        Alan N
        wrote on last edited by
        #3

        Take a CheckBox and change the Appearance property from Normal to Button and it will behave exactly as you want. Respond to the CheckChanged event to find out when the 'pressed' state changes. Alan.

        1 Reply Last reply
        0
        • M Midnight Ahri

          i would love to change windows button to keep pressed when i press it and back to the normal state when pressed again. does windows button support dat? :sigh:

          M Offline
          M Offline
          Meshack Musundi
          wrote on last edited by
          #4

          If you're using WPF you can make use of the Toggle Button.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups