Disabled buttons

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BrianDH

    #1

    Disabled buttons

    Hi

    Is there a way to keep a button from turning gray when its disabled?

    Thanks

    BrianDH
  • Crouchie1998

    #2
    Re: Disabled buttons

    Hi Brian,

    Add a button to a form & also add a checkbox

    Private Sub CheckBox1_Check edChanged(ByVal sender As System.Object,
    ByVal e As System.EventArg s) Handles CheckBox1.Check edChanged
    If CheckBox1.Check ed Then
    Button1.Enabled = False
    Button1.BackCol or = Color.Red
    Else
    Button1.Enabled = True
    Button1.BackCol or = Color.LightGray
    End If
    End Sub

    Try something like the above

    Crouchie1998
    BA (HONS) MCP MCSE


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Disabled buttons

      "BrianDH" <BrianDH@discus sions.microsoft .com> schrieb:[color=blue]
      > Is there a way to keep a button from turning gray when its disabled?[/color]

      Override your button's 'OnPaint' method and place custom drawing code there.

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      • BrianDH

        #4
        Re: Disabled buttons

        TY

        "Crouchie19 98" wrote:
        [color=blue]
        > Hi Brian,
        >
        > Add a button to a form & also add a checkbox
        >
        > Private Sub CheckBox1_Check edChanged(ByVal sender As System.Object,
        > ByVal e As System.EventArg s) Handles CheckBox1.Check edChanged
        > If CheckBox1.Check ed Then
        > Button1.Enabled = False
        > Button1.BackCol or = Color.Red
        > Else
        > Button1.Enabled = True
        > Button1.BackCol or = Color.LightGray
        > End If
        > End Sub
        >
        > Try something like the above
        >
        > Crouchie1998
        > BA (HONS) MCP MCSE
        >
        >
        >[/color]

        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: Disabled buttons

          "BrianDH" <BrianDH@discus sions.microsoft .com> schrieb:[color=blue]
          > Is there a way to keep a button from turning gray when its disabled?[/color]

          Override your button's 'OnPaint' method and place custom drawing code there.

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://classicvb.org/petition/>

          Comment

          • BrianDH

            #6
            Re: Disabled buttons

            TY

            "Crouchie19 98" wrote:
            [color=blue]
            > Hi Brian,
            >
            > Add a button to a form & also add a checkbox
            >
            > Private Sub CheckBox1_Check edChanged(ByVal sender As System.Object,
            > ByVal e As System.EventArg s) Handles CheckBox1.Check edChanged
            > If CheckBox1.Check ed Then
            > Button1.Enabled = False
            > Button1.BackCol or = Color.Red
            > Else
            > Button1.Enabled = True
            > Button1.BackCol or = Color.LightGray
            > End If
            > End Sub
            >
            > Try something like the above
            >
            > Crouchie1998
            > BA (HONS) MCP MCSE
            >
            >
            >[/color]

            Comment

            Working...