Results 1 to 4 of 4

Thread: command button pressed look

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    California, USA
    Posts
    111

    Question

    Is it possible to make a button stick and not pop up when it is pressed like with toolbar buttons? Thanks.

  2. #2
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    add the Microsoft Forms 2.0 controls, it includes the Toggle button control
    NXSupport - Your one-stop source for computer help

  3. #3
    Addicted Member Stephen Bazemore's Avatar
    Join Date
    Aug 2000
    Location
    North Carolina
    Posts
    158
    Another way is to just use a check box and set it's style property to "Graphical"
    It looks real nice.
    Stephen Bazemore
    Email:[email protected]

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'this really looks too cool...
    'can't get it to work with the normal button look but
    'if I use the sunken 3d effect and call it to set it
    'looks really really good...sunken and stays sunken.
    'to view it copy and paste this code.
    'Form1  Command1
    '
    
    
    Option Explicit
    
    Public PixX, PixY, CTop, Clft, CRgt, CBtm, i, AddX, AddY
    Public nowDown As Boolean
    
    Public Sub ThreeDControl(Ctrl As _
    Control, nBevel, nSpace, bInset)
    
    PixX = Screen.TwipsPerPixelX
    PixY = Screen.TwipsPerPixelY
    
    CTop = Ctrl.Top - PixX
    Clft = Ctrl.Left - PixY
    CRgt = Ctrl.Left + Ctrl.Width
    CBtm = Ctrl.Top + Ctrl.Height
    
    ' Color used below:
    ' dark gray = &H808080
    ' white = &HFFFFFF
    
    If bInset Then         'inset border
      For i = nSpace To (nBevel + nSpace - 1)
       AddX = i * PixX
       AddY = i * PixY
       Ctrl.Parent.Line (Clft - AddX, CTop - _
       AddY)-(CRgt + AddX, CTop - AddY), &H808080
       Ctrl.Parent.Line (Clft - AddX, CTop - _
       AddY)-(Clft - AddX, CBtm + AddY), &H808080
       Ctrl.Parent.Line (Clft - AddX, CBtm + _
       AddY)-(CRgt + AddX + PixX, CBtm + AddY), &HFFFFFF
       Ctrl.Parent.Line (CRgt + AddX, CTop - _
       AddY)-(CRgt + AddX, CBtm + AddY), &HFFFFFF
      
        Next
            Else                      'outset border
      For i = nSpace To (nBevel + nSpace - 1)
       AddX = i * PixX
       AddY = i * PixY
       Ctrl.Parent.Line (CRgt + AddX, CBtm + _
        AddY)-(CRgt + AddX, CTop - AddY), &H808080
       Ctrl.Parent.Line (CRgt + AddX, CBtm + _
        AddY)-(Clft - AddX, CBtm + AddY), &H808080
       Ctrl.Parent.Line (CRgt + AddX, CTop - _
        AddY)-(Clft - AddX - PixX, CTop - AddY), &HFFFFFF
       Ctrl.Parent.Line (Clft - AddX, CBtm + _
        AddY)-(Clft - AddX, CTop - AddY), &HFFFFFF
      Next
    End If
    
    End Sub
    
    Private Sub Command1_Click()
    
    If nowDown = False Then
     Call ThreeDControl(Command1, 1, 0, True)
     Command1.Width = 1215
     Command1.Height = 495
      nowDown = True
    Else
    nowDown = False
    Command1.Width = 1250
    Command1.Height = 525
    Command1.Refresh
    
    End If
    
    End Sub
    
    Private Sub Form_Activate()
    Call ThreeDControl(Command1, 1, 0, True)
     Command1.Width = 1215
     Command1.Height = 495
      nowDown = True
      Call Command1_Click
      
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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