VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A Very Flat Std Command Button

by ULLI (93 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

Make a standard command button very flat ;-)

Rate A Very Flat Std Command Button

Option Explicit
Private Type RECT
  Left  As Long
  Top   As Long
  Right  As Long
  Bottom As Long
End Type
Private WindowRect  As RECT
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Sub Form_Load()
 Const SnippOff  As Long = 3
 Dim hRgn     As Long
  With WindowRect
    .Left = SnippOff
    .Top = SnippOff
    .Right = ScaleX(Command1.Width, ScaleMode, vbPixels) - SnippOff
    .Bottom = ScaleY(Command1.Height, ScaleMode, vbPixels) - SnippOff
    hRgn = CreateRectRgn(.Left, .Top, .Right, .Bottom)
    SetWindowRgn Command1.hWnd, hRgn, True
    DeleteObject hRgn
  End With
End Sub

Download this snippet    Add to My Saved Code

A Very Flat Std Command Button Comments

No comments have been posted about A Very Flat Std Command Button. Why not be the first to post a comment about A Very Flat Std Command Button.

Post your comment

Subject:
Message:
0/1000 characters