DISCOVER
×

How to Remove the Command Button Border with VB6

Updated July 19, 2017

Each element in a Visual Basic 6 (VB6) application has a "borderstyle" property. The property draws a thin line around the element, including a button element. To remove the border, you set the borderstyle property to "0." Setting the border width to "0" pixels means no border is drawn when the VB6 form displays on the user's desktop.

Click the Windows "Start" button, and select "Visual Basic" in the "All Programs" group. Click "Visual Basic 6" to open the compiler software.

Click the "File" menu item followed by "Open." Double-click your Visual Basic 6 application file in the dialogue window to open it in the compiler.

Double-click the form that contains the button you want to edit. When the form loads in the designer, double-click the button you want to edit.

Type the following code in the code editor:

button1.BorderStyle = 0

Replace "button1" with the name of the button you want to edit. Setting the style to "0" displays no border around the control.

bibliography-icon icon for annotation tool Cite this Article

About the Author

Jim Campbell has been a computer engineer for over five years. He excels in hardware repair, computer programming and troubleshooting, and software design. He is currently attending Florida Atlantic University, pursuing a master's degree in computer and electrical engineering and fine-tuning his technical writing abilities.