+ Reply to Thread
Results 1 to 10 of 10

Vertical Text on a Control Button

Hybrid View

laterdaysluke Vertical Text on a Control... 09-30-2010, 02:31 PM
romperstomper Re: Vertical Text on a... 09-30-2010, 03:31 PM
laterdaysluke Re: Vertical Text on a... 09-30-2010, 03:56 PM
TMS Re: Vertical Text on a... 09-30-2010, 04:04 PM
laterdaysluke Re: Vertical Text on a... 09-30-2010, 04:08 PM
romperstomper Re: Vertical Text on a... 09-30-2010, 04:19 PM
laterdaysluke Re: Vertical Text on a... 09-30-2010, 04:31 PM
romperstomper Re: Vertical Text on a... 09-30-2010, 04:46 PM
TMS Re: Vertical Text on a... 09-30-2010, 05:44 PM
Andy Pope Re: Vertical Text on a... 10-01-2010, 06:02 AM
  1. #1
    Registered User
    Join Date
    07-24-2008
    Location
    Dallas
    Posts
    17

    Vertical Text on a Control Button

    How can I make the text on a control button vertical? This can be done on a general form button, but I can't access all the properties fo this type of button programmatically like I can for a control button. Any idea how make the text vertical on a control button? Either just purely in the excel menus or programmatically?


    Thanks!

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: Vertical Text on a Control Button

    I don't believe you can with an ActiveX button. I'd also recommend using the Forms ones in preference unless you have a real need for the ActiveX type.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    07-24-2008
    Location
    Dallas
    Posts
    17

    Re: Vertical Text on a Control Button

    With the forms button, I cant figure out how to access all the properties. For example, when you click it, how can I change the properties so that it appears selected? Where can I find the different properties that I have access to?

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,529

    Re: Vertical Text on a Control Button

    You could create the text in something like Paint and save it.

    Assign it to the Command Button using:

    CommandButton1.Picture = LoadPicture("C:\Users\...\Pictures\....jpg")

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    07-24-2008
    Location
    Dallas
    Posts
    17

    Re: Vertical Text on a Control Button

    Yeah, I dont really want to go down that route. If there was a way to access more of the form button's properties via vba, then that would be a pretty good solution. Pretty much I just need to be able to access either the fill color or something like that to show it has been clicked.

    Thanks!

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: Vertical Text on a Control Button

    You can't, other than changing the caption for example. Why is it not obvious that it's been pressed from what it does?

  7. #7
    Registered User
    Join Date
    07-24-2008
    Location
    Dallas
    Posts
    17

    Re: Vertical Text on a Control Button

    It will be pressed almost like a check box is checked. The selection doesn't really have any value or meaning until some other buttons are pressed. The crux of the issue here is that I need these 2 features, which almost seem mutually exclusive edxcept for some workarounds: rotated text and a button indicating it has been selected.

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: Vertical Text on a Control Button

    Sounds like an unusual design to me. Can you elaborate a little so we can try and think of some alternatives or other workarounds?

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,529

    Re: Vertical Text on a Control Button

    One way:

    A picture paints ...

    Dim bButtonpressed As Boolean
    
    Private Sub CommandButton1_Click()
    
    If Not bButtonpressed Then
        CommandButton1.Picture = LoadPicture("C:\cross.bmp")
        bButtonpressed = True
    Else
        CommandButton1.Picture = LoadPicture("C:\tick.bmp")
        bButtonpressed = False
    End If
    
    End Sub


    Use this code with the attached bitmaps to indicate ticked or not.

    Regards
    Attached Images Attached Images

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Vertical Text on a Control Button

    This will alternate horizontal / vertical text on an activex button.

    Private Sub CommandButton1_Click()
        
        Dim strText As String
        Dim lngIndex As Long
        
        strText = CommandButton1.Caption
        If InStr(strText, Chr(13)) > 0 Then
            strText = Replace(strText, vbCrLf, "")
        Else
            For lngIndex = Len(strText) - 1 To 1 Step -1
                strText = Left(strText, lngIndex) & Chr(13) & Mid(strText, lngIndex + 1)
            Next
        End If
        CommandButton1.Caption = strText
        
    End Sub
    Although I agree you may need to re think your UI.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1