twinBASIC Update: January 14, 2025
On April 23, 2021, I helped Wayne Phillips introduce the world to twinBASIC at the Access DevCon Vienna conference. I boldly predicted that twinBASIC (along with the Monaco editor) would replace VBA and its outdated development environment by 2025. With that goal in mind, this weekly update is my attempt to keep the project fresh in the minds of the VBA development community.
Every Sunday Monday week, I will be providing updates on the status of the project, linking to new articles discussing twinBASIC, and generally trying to increase engagement with the project. If you come across items that should be included here, please leave a comment below.
Here are some links to get involved with the project:
- Custom twinBASIC IDE Installation Guide
- twinBASIC Discord Server (chat about the project)
- twinBASIC Wiki (list of new features not in VBx)
- GitHub Issue Tracker (report bugs)
- twinBASIC/VBx LinkedIn Group
Highlights
Theme Support for the twinBASIC IDE
Official support for customizable themes has arrived as of BETA 645.
The development focuses on providing extensive theming capabilities with over 320 customizable properties. Community engagement has been strong, with immediate interest in theme development and add-in integration possibilities. For usage instructions, refer to the README.txt file in the themes
folder of the twinBASIC ZIP file.
For all the latest theme-related developments, subscribe to the new Themes channel on the tB Discord server.
Theme System Implementation
- Wayne Phillips announced the launch of customizable themes with a new inheritance-based system, allowing users to extend existing 'dark' or 'light' themes with custom properties
- The system uses CSS-compatible value formats for properties, with over 320 customizable elements currently available
- Theme files require the 'inherits' statement to ensure compatibility with future updates and proper Dark/Light indicators in the menu system
IDE Integration & Development
- Current theme loading is limited to IDE startup, with plans to add a "refresh" method to the IDE Addin extensibility model for real-time preview capabilities
- Wayne indicated plans to migrate font settings from IDE Settings into the theme system, while keeping font-size settings in their current location
- The team is considering including community-developed themes in future releases, opening the door for user contributions
New UserControl Events: PreKeyUp and PreKeyDown
From Wayne in Discord:
.For those of you that create UserControls and rely on InPlaceActiveObject (IPAO) to do custom keyboard handling, you might want to consider using the new PreKeyDown/PreKeyUp events in the latest release, BETA 643. You must switch PreKeyEvents property to True, and then any keyboard events inside your UC will fire the new events before they get processed by the host or the target child window. These new events fire for all child window descendants of your UC, even for custom windows created with CreateWindow().
In the majority of cases, this feature should remove the need to resort to IPAO for capturing and manipulating keyboard events like TAB/ESC/ARROWs etc in your UCs. Inside the new events, you can simply set KeyCode = 0 to mute the event from being processed further.
User Tecman confirmed the importance of this new feature and provided some practical examples of its use:
For my part, I can confirm that this is a great addition to twinBASIC. Even if you don't create ActiveX controls with nested controls, this new feature will allow you to intercept special keys like TAB, ENTER, ESC in development environments like Microsoft Access without using such “heavy artillery” as OS system hooks or the same IOleInPlaceActiveObject interface. I've already tried this functionality in my real-world project, and it was like a breath of fresh air. Now I can do what I need to do using a simple VB6-style approach!
Discord Chat Summary
* Auto-generated via Claude-3.5-Sonnet-200k on poe.com
Overview
This week saw significant developments in IDE customization with the introduction of theme support, alongside continued performance optimization discussions and bug fixes. Community engagement was high, with particularly active discussions around IDE improvements and backwards compatibility features. Wayne Phillips made several key announcements about upcoming features and current development priorities.
Performance & Optimization
- Performance testing showed twinBASIC significantly outperforming VB6 in graphics and text handling operations (reported by community members)
- Wayne Phillips confirmed LLVM optimization support remains on track for v1.0 release, with potential for massive performance gains
- The
Project: Codegen Model
setting's "Fast" option was clarified by Wayne as primarily affecting code size rather than performance
IDE Enhancements
- Wayne Phillips announced official theme support in BETA 645, introducing customizable CSS-based themes
- A new "Classic" light theme was previewed, aimed at providing a more VB6-like experience
- New
PreKeyDown
/PreKeyUp
events were added in BETA 643 for improved keyboard handling in UserControls - Community discussions highlighted the importance of maintaining high contrast options for accessibility
Bug Fixes & Stability
- Wayne advised staying on BETA 622 for production work until some important issues are resolved
- Fixed a bug where form anchoring wasn't working correctly when changing form size in Load event
- Acknowledged known issue with "Resync required" messages appearing on compiler restart
Language Features
- Confirmed the alternate
CType
syntax using "As" keyword is still planned but not yet implemented - Clarified that exposing module procedures through type libraries isn't supported to maintain VB6 compatibility
- Discussion of compiler constant support for packages remains under consideration
Conclusion
The week demonstrated significant progress in IDE customization and user experience improvements, while maintaining focus on performance optimization and stability. The introduction of theme support represents a major step forward in IDE flexibility, while continued work on LLVM optimization shows commitment to performance goals. Community feedback remains central to development priorities, particularly regarding accessibility and backwards compatibility.
Around the Web
BREAKING NEWS: XYplorer goes twinBASIC
Big news this week (though not entirely unexpected if you've been reading these weekly updates): XYplorer is switching from VB6 to twinBASIC. Here's the official announcement:
I'm happy to officially announce that XYplorer will switch from Visual Basic 6 to twinBASIC (https://twinbasic.com/) this year. The advantages are numerous and overwhelming. To name just a few:
- XYplorer.exe will be a 64-bit executable with full support for 64-bit preview handlers, 64-bit thumbnail providers, 64-bit IFilters, 64-bit context menu, 64-bit codecs, 64-bit you name it (XY64.exe, XY64ctxmenu.exe, and XY64contents.exe are no longer needed).
- Full multi-threading (XYcopy.exe is no longer needed).
- Full Unicode support throughout the user interface, so all Unicode characters work always and everywhere, regardless of the OS system language (aka locale).
- No more 100MB string memory limit.
- Cross-platform support planned: Mac, Linux and Android.
- XYplorer will be even faster than it already is thanks to a greatly improved compiler.
- Note that all current licenses for the 32-bit version will be valid for the upcoming 64-bit version. Full continuity guaranteed.
- Last but not least: Using a modern living language like twinBASIC will make development even faster and much easier. I can tell you: Writing this application in VB6 (dead since 1998) was a black art. I often felt like a voodoo programmer.
There's still a lot of work to be done, but I expect to see tangible results in the first half of 2025.
twinBASIC Powers XYplorer's Future: HN Reacts
A lively discussion broke out on Hacker News this week when users discovered that the popular file manager XYplorer was written in VB6.
The conversation, which drew over 200 comments, initially focused on the merits of building modern software with "legacy" languages before shifting to modernization strategies after XYplorer's developer announced plans to migrate to twinBASIC. While twinBASIC wasn't the primary focus of the discussion, it received consistently positive mentions as a practical solution for VB6 modernization, with particular interest in its 64-bit compilation capabilities and backwards compatibility. The discussion highlighted how twinBASIC is gaining recognition beyond our immediate community, particularly among developers maintaining business-critical VB6 applications.
The broader developer community's reaction suggests that twinBASIC is increasingly being seen as the de facto solution for modernizing VB6 applications while preserving existing investments in code and developer expertise.
AI-generated summary via Claude-3.5-Sonnet
Changelog
Here are the updates from the past week. You can also find this information by visiting the GitHub twinBASIC Releases page.
AI-Generated Changelog Summary
* Auto-generated via Claude-3.5-Sonnet, sorted in order of its opinion of "most impactful changes."
Here's a concise summary of the notable updates in twinBASIC:
-
Theme System Enhancement: Added comprehensive theming support with 121 new theme-able properties, including a redesigned 'Light' theme and new 'Classic' theme. The IDE now remembers the last selected theme between sessions.
-
UserControl Improvements: Added new PreKeyEvents functionality with PreKeyDown/Up events and related properties, enhancing keyboard event handling capabilities.
-
IDE Enhancements:
- Added VS Code-style CTRL+D shortcut for adding selection to next find match
- Improved property sheet with sticky control selector
- Fixed navigation dropdown issues in the code editor
- Streamlined IDE options by integrating several settings into the theme system
-
Form and Control Fixes: Resolved several compatibility issues including form icon sizing, menu click events, and ampersand rendering in labels, improving VB6/VBA compatibility.
WARNING: The following issues are present in BETA builds 623 - 647 (the latest build as of publication):
- IMPORTANT: This is an interim/experimental release. It includes significant changes, so some instability is to be expected. [Editor's Note: Rolling back to BETA 622 may be necessary until the BETA 623+ version stabilizes or if any of the KNOWN ISSUES below affect your project.]
- KNOWN ISSUE: UserControls from the ACTIVE project will not appear correctly in the form designer in this release (they are purposely disabled until next release). Packaged controls, such as VBCCR will work.
- KNOWN ISSUE: Menus currently not appearing in MDI Forms (broken in this build)
- KNOWN ISSUE: 'Scale*' properties are often not settable in the IDE property sheet (broken in this build)
- KNOWN ISSUE: Setting Width/Height via the property sheet often does not work correctly (broken in this build)
- KNOWN ISSUE: Controls are not being destroyed properly by the form designer, causing big memory leaks (broken in this build)
- there are known memory leaks in these versions, so memory usage will be higher than at the Version 1.0 release
BETA 638
- improved: performance of runtime configurating menu items when the form is not visible [ Xyplorer, private ]
- fixed: 'Picture' properties of forms & controls now better handles the empty case, substituting an Empty StdPicture instead of Nothing [ XYplorer, private ]
- fixed: some edge cases around AutoRedraw handling [ XYplorer, private ]
- fixed: some ScaleMode edge cases when a control has been re-parented to another tB control [ XYplorer, private ]
- fixed: (regression) accessing a control array element before the container form is loaded would fail [ XYplorer, private ]
- fixed: Menu Click event not firing when there are submenus associated with it [ XYplorer, private ]
- fixed: form designer could fail or render incorrectly if a PictureBox has AutoSize property set to TRUE [ XYplorer, private ]
- fixed: support for passing the control array Index via Form.Controls(Name, Index) as per VBx support [ XYplorer, private ]
BETA 639
- fixed: (regression in BETA 638) VB.Menu implementation had a Declare with a missing PtrSafe
BETA 640
- fixed: support for outputting UDT member cstyle arrays in TLBs
BETA 641
- fixed bug in WM_SHOWWINDOW handling, which can cause focus issues for AX hosts when a containing form hosting an tB AX control is closed
BETA 642
- [REVOKED]
BETA 643
- added: UserControl PreKeyEvents boolean property (default False), and PreKeyDown/Up events (plus PreKeyWParam/LParam properties for accessing raw message data) [ Tecman, discord ]
- changed: 'Return Without Gosub' is now a warning (TB0027) rather than an error for back compat concerns
- fixed: some cases of IDE error 'unable to close floating panel' [ Tecman, discord ]
- fixed: with UseMnemonic property set to True, Label wouldn't render double ampersand correctly [ https://github.com/twinbasic/twinbasic/issues/1990 ]
- fixed: code navigation comboboxes in the code editor could fail to populate [ https://github.com/twinbasic/twinbasic/issues/1992 ]
- fixed: wrong ICO size selected for form icons when multiple sizes are available [ https://github.com/twinbasic/twinbasic/issues/1987 ]
BETA 644
- added: UserControl.PreKeyTargetHWND property for use inside PreKeyDown/Up events
BETA 645
- renamed: UserControl.PreKeyTargetHWND to PreKeyTargetHwnd [ Krool, discord ]
- added: IDE command tbEditor_AddSelectionToNextFindMatch, default bound to CTRL+D shortcut to match VS Code [ woeoio2, discord ]
- added: support for customizable themes [ see themes/README.txt or see discord #themes channel ]
- improved: last selected theme will now be remembered for the next IDE run
- removed: use of old CSS files styles-twinbasic-dark / styles-twinbasic-light
BETA 646
- added 121 new theme-able properties
- improved: redesigned the 'Light' theme
- added: 'Classic' theme (same as Light theme, but without semantic highlighting)
- fixed: (regression) right-click inside form designer would place the context menu at the wrong position
- removed IDE option 'Monaco: Render Indent Guides', use theme property CodeIndentGuideVisible instead
- removed IDE option 'Monaco: Show Minimap', use theme property CodeMinimapVisible instead
- removed IDE option 'Monaco: Show Folding Controls', use theme property CodeFoldingVisible instead
- removed IDE option 'Compiler: Start In 64-bit Mode', as the IDE now remembers the target architecture between sessions
- removed IDE option 'Bracket pair colorization in code editor', use theme property CodeBracketPairColorization instead
BETA 647
- fixed: population of ProductName in VERSION block now falls back to using App.Title if ProductName is not set, to match VBx [ kimpos, private ]
- fixed: reading VERSION block information via App properties could return truncated strings in compiled builds
- improved: property sheet control selector is now sticky, kept visible when the properties are scrolled [ sokinkeso, discord ]
- fixed: (regression) CommandButton/CheckBox/OptionButton Graphical style text position was wrong in recent releases [ sokinkeso, discord ]