Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AcctPgm/FMsgBox
VBA message box with formatting for the message text
https://github.com/AcctPgm/FMsgBox
Last synced: 8 days ago
JSON representation
VBA message box with formatting for the message text
- Host: GitHub
- URL: https://github.com/AcctPgm/FMsgBox
- Owner: AcctPgm
- License: agpl-3.0
- Created: 2020-05-10T19:55:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-15T03:52:44.000Z (over 4 years ago)
- Last Synced: 2024-11-30T00:26:49.968Z (12 days ago)
- Language: VBA
- Size: 33.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - AcctPgm/FMsgBox - VBA message box with formatting for the message text (VBA)
README
# FMsgBox
A VBA class module __clsFMsgBox__ and userform __frmFMsgBox__ that can act as a replacement
for the standard MsgBox, but that allows some formatting of the message text using tags.
## Usage:
a) This will show a message with 'done' in bold and red text, with an OK button.
````
Dim FMsgBox as clsFMsgBox
Set FMsgBox = new clsFMsgBox
FMsgBox "Congratulatins, you're done!"
````b) This will show a bulletted list, and Yes and No buttons with No as the default
````
Dim FMsgBox as clsFMsgBox
Dim Response as vbMsgBoxResult
set FMsgBox = new clsFMsgBox
With FMsgBox
.FormTitle = "Status"
.FormButtons = vbYesNo + vbDefaultButton2
.Msg = "Meetings are set for:" & _
"
- Monday
"
- Wednesday
"
- Friday
"
Do you want to accept the invitation?"
Response = .Dsply
End With
````
## Format tags:
Apply formatting to the message (prompt) text by embedding tags in the text. Some tags
are similar to HTML, but this isn't intended to be a full HTML interpreter so they
generally don't follow.
Most tags are paired as , with any text between receiving the format.
### Colours:
The exact RGB values for the colours may be set through FMsgBox properties
````
````
The default text colour is black. It may be set through FMsgBox properties
### Formats:
````
Bold
Underline
Italic
Add a background highlight colour to the text
By default the highlight is yellow but may be set
through FMsgBox properties
````
### Line break:
````
Start a new line
vbLf (chr$(10)), vbCr (13), vbCrLf (13+10), and
vbNewLine (13+10) are all treated as a
````
### Tabs:
````
Advance to the next tab stop position
If the position isn't defined, text will be at the next
default tab position based on the text size.
Save the current position as a tab stop. This allows
taxt to be left-aligned as the position without
worrying about the width of preceeding text in the line
Remove the defined stop, reverting to default positiong
````
### Indents and Lists:
````
Indent text by the width of four space charactersa
The size of the indent, in space characters, may be
set through FMsgBox properties
The number increments after each entry
The bullet character may be set through FMsgBox properties
````