DPI-Aware Rounded Panels for Access Forms (GDI+ “Pills”)

Premium
Rounded Panels for Access Forms

What it is
A lightweight VBA module (modRoundedPanel.bas) that renders rounded rectangles with optional shadows using GDI+, saves them to your %TEMP% folder, and links them to Image controls sitting behind your TextBox/ComboBox/etc. This gives modern, rounded UI without embedding bitmaps or custom ActiveX controls.
Highlights
• DPI-aware (twips↔pixels) for sharp edges on any scaling.
• GDI+ anti-aliasing + pixel-offset = razor-clean borders.
• Tiny footprint: images are linked, not embedded.
• 32/64-bit compatible (#If VBA7 Then guards).
• Helpers included:
o AlignPanelTo / AlignPanelTo4 – line up a panel behind one control.
o StylePanels / ApplyPresetRounded6 – batch style multiple fields.
o PanelFocusOn/Off, PanelInvalidOn/Off – visual focus/validation states.
• Safe save fallback to BMP if PNG encoders aren’t available.
Requirements
• Microsoft Access on Windows (VBA6/VBA7).
• GDI+ available on Windows (built-in).
• An Image control per target control (convention: img_) or a single Image you position manually.
Install
1. Import modRoundedPanel.bas into your Access project.
2. On your form, add Image controls behind the fields you want to style, e.g. img_txtFrom, img_txtTo, img_cboPlant.
3. (Optional) Set your input controls to Flat/Transparent to avoid double borders:
o SpecialEffect = 0 (Flat), BorderStyle = 0 (Transparent).
Note: some theme settings are design-time; no drama if they stick—your pill still looks good.
4. Call a preset in your form events:

Code

No code provided in the “Code” field.

© 2026 BeniroDev