Make Buttons Appear

Make Buttons Appear

VB doesn’t display the Min and Max buttons in a form’s caption area when you specify BorderStyle Fixed Dialog. If you set the MinButton and MaxButton properties on the form to True, the Minimize and Maximize entries in the context menu are visible-but the buttons are still invisible! To fix this, add this code to a standard module:

 Private Declare Function GetWindowLong Lib "user32" Alias _	"GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As _	Long) As LongPrivate Declare Function SetWindowLong Lib "user32" Alias _	"SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As _	Long, ByVal dwNewLong As Long) As LongPrivate Const GWL_STYLE = (-16)Private Const WS_MINIMIZEBOX = &H20000Private Const WS_MAXIMIZEBOX = &H10000Public Sub SetCaptionButtons(Frm As Form)	Dim lRet As Long	lRet = GetWindowLong(Frm.hWnd, GWL_STYLE)	SetWindowLong Frm.hWnd, GWL_STYLE, lRet Or _		WS_MINIMIZEBOX * (Abs(Frm.MinButton)) Or _		WS_MAXIMIZEBOX * (Abs(Frm.MaxButton))End Sub

You must call the subroutine SetCaptionButtons from the Form_Load event, passing a reference to your form. This should work in VB3 and VB4 16 with the proper 16-bit API declarations (see “Remove Min/Max Buttons From MDI Form”).

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes