Results 1 to 7 of 7

Thread: [RESOLVED] How to keep the command button pressed?

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2007
    Posts
    56

    Resolved [RESOLVED] How to keep the command button pressed?

    Hi Guys!

    I really need your help. My form is shown in the attached file. How will a keep the command button for bold, italic and underline pressed once a user clicks on it ones? and back to unpressed when clicked for the second time. or maybe perhaps change the color background of the command button just like in MS Office 2007.

    Would you help me please? Thank you.

    Regards,
    BarberCut
    Attached Images Attached Images  

  2. #2
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: How to keep the command button pressed?

    Use a CheckBox control with the Style property set to Graphical. The ToolBar control can also do this but it doesn't look like you're using one.

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: How to keep the command button pressed?

    change the caption of the button to suit
    in the click event
    commandbold.font.bold = not commandbold.font.bold
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  4. #4

    Thread Starter
    Member
    Join Date
    Feb 2007
    Posts
    56

    Re: How to keep the command button pressed?

    Hi DigiRev!

    Thank you. I tried it but the only difference with the command button is the type of control. It looks the same but I still can't make it stay in pressed mode.

    Hi westconn1!

    Thank you. What do you mean, change the caption of the button to suit in the click event? I'm sorry but I don't understand.

    Thank you.

    Regards,
    BarberCut

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to keep the command button pressed?

    Quote Originally Posted by DigiRev
    Use a CheckBox control with the Style property set to Graphical.
    Did you try this? (This is in place of the command button)

  6. #6
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: How to keep the command button pressed?

    Here is an example including what I think westconn was telling you.
    Attached Files Attached Files

  7. #7

    Thread Starter
    Member
    Join Date
    Feb 2007
    Posts
    56

    Re: How to keep the command button pressed?

    Thank you so much guys! I appreciate your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width