Results 1 to 3 of 3

Thread: flat buttons

  1. #1

    Thread Starter
    Addicted Member Dementia Freaks's Avatar
    Join Date
    Jun 2001
    Location
    Canada
    Posts
    132

    Cool flat buttons

    probably a simple properties thing but i would like to make my buttons flat with a single color border and no selection. like using a picture for a button. can i?
    Gray FOX: "Only a fool, trusts his life to a Weapon!"

    Bart Simpson: "Bart no like! Baaad medicene!"

    www.sling.to/dementia-freaks <<<---Goto my site!

    http://pub80.ezboard.com/bdementiafreaksforum <<<---Goto my forum!

    Thats it!

  2. #2
    Addicted Member
    Join Date
    Mar 2000
    Location
    Suffolk. UK
    Posts
    162
    Yep, just use a picture as you would a button.

  3. #3
    LamagrA
    Guest
    put this in a module :
    Code:
    Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
    
    Private Declare Function GetWindowLong Lib "user32" Alias _
            "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias _
            "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
            ByVal dwNewLong As Long) As Long
    Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
            ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, _
            ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    
    Private Const GWL_EXSTYLE = (-20)
    Private Const WS_EX_CLIENTEDGE = &H200
    Private Const WS_EX_STATICEDGE = &H20000
    
    Private Const SWP_FRAMECHANGED = &H20
    Private Const SWP_NOMOVE = &H2
    Private Const SWP_NOOWNERZORDER = &H200
    Private Const SWP_NOSIZE = &H1
    Private Const SWP_NOZORDER = &H4
    
    Public Function AddOfficeBorder(ByVal hwnd As Long)
        
        Dim lngRetVal As Long
        
        lngRetVal = GetWindowLong(hwnd, GWL_EXSTYLE)
    
        lngRetVal = lngRetVal Or WS_EX_STATICEDGE And Not WS_EX_CLIENTEDGE
    
        SetWindowLong hwnd, GWL_EXSTYLE, lngRetVal
        SetWindowPos hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_NOZORDER Or SWP_FRAMECHANGED
        
    End Function
    you use it like this (in form_load is the best place): addofficeborder (command1.hwnd)

    greetz

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