Can the border properties of a UserForm be changed through Windows API calls..?

spinjector

New Member
Joined
Aug 2, 2021
Messages
1
Office Version
  1. 365
  2. 2019
  3. 2007
Platform
  1. Windows
I recently started using Excel 2019 on Windows 10. In this environment, Windows places a thin red border around VBA UserForms, and there are no properties within VBA to change it. In the screenshot below, I've changed the UserForm border style to 'Thin' & color to 'Black' to show what I mean. What used to be the UserForm border is now only around the "control space" below the title bar.

I'm not fond of this appearance, and I'd like to set the border width, color, and the style to a more traditional '3D'. But the old 3D isn't an option in VBA; I thought perhaps it might still be available through Windows.

So.....can Windows API calls be used to do any of this..?

I've searched Google and found surprisingly little on this topic. This StackOverflow page comes close, but it only gets the border width, and doesn't set it. And it does nothing with the color or style.

Capture.PNG
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top