ToolButton Toggle Q. (solved)

Hi. I have been researching and can’t find an answer. Using the ToolButtton in ToggleButton style mode … Can you prevent a user from toggling twice?

My Example That I desire:

  1. Button Begins Not Toggled
  2. USer clicks on Button and Toggles it (down position)
  3. User clicks Button again and toggles it (up or non toggled position).

My question is how do I prevent the button from doing #3 :slight_smile: How can I keep the Button toggled down and then I would “un toggle” when a user presses on another button.

  Dim CredentialManagementToolButton As New ToolButton
  CredentialManagementToolButton.Style = ToolButton.ToolStyleToggleButton
  CredentialManagementToolButton.Caption = " Credentials "
  CredentialManagementToolButton.Icon = application_key

CredentialManagementToolButton.Pushed = Not CredentialManagementToolButton.Pushed

Thank you in advance!!

Could you disable it after the first press? Then the user can’t click on it any more.

:slight_smile: Nice idea Marc. I will try and let you know. Thanks!

It worked, but of course it grayed out my button icon.

ToolButton(me.item(0)).Enabled = false

I need to try to get the same results without the button icon graying out :slight_smile: Thanks again!

I am trying to mimic the “Preferences” From Xojo… They are doing it so I know it can be done with ToolButtons :slight_smile:

I thought I had it, but it didn’t work after some additional testing. If anyone has any thoughts please advise :slight_smile: Thank you!

This works so that no matter how many times I click on the same toggle button it stays pressed until I press another button.

SUB Action(Item as ToolItem)
  if item.Caption =  " Credentials " then
    CLI_Cred_Manager_Controls1.Visible = true
    ToolButton(me.item(0)).Pushed = true
  elseif item.Caption = " Target Setup " Then
    CLI_Cred_Manager_Controls1.Visible = False
    ToolButton(me.item(1)).Pushed = True
  elseif item.Caption = " Logging Options " then
    ToolButton(me.item(2)).Pushed = True
  end if