home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Streaming_2113155182008.psc / ButtonFlat.bas < prev    next >
BASIC Source File  |  2008-05-10  |  576b  |  11 lines

  1. Attribute VB_Name = "ButtonFlat"
  2. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  3. Private Const BS_FLAT = &H8000&
  4. Private Const GWL_STYLE = (-16)
  5. Private Const WS_CHILD = &H40000000
  6.  
  7. Public Function btnFlat(Button As CommandButton)
  8.     SetWindowLong Button.hWnd, GWL_STYLE, WS_CHILD Or BS_FLAT
  9.     Button.Visible = True 'Make the button visible (its automaticly hidden when the SetWindowLong call is executed because we reset the button's Attributes)
  10. End Function
  11.