Changing Message box font

Started by fhammer, June 13, 2014, 12:23:48 PM

Previous topic - Next topic

fhammer

Is there a way to change the Message box font? Thank you.

Deana

The Message function only uses System fonts defined by the user. If you want to display a custom message using specific fonts then you could use a WIL Dialog. For example:

Code (winbatch) Select

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; Customized Message Box
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
strTitle = 'My Message'
strText = 'Hello World, Welcome the the wonderful world of WinBatch'

; The font used to display a control's text. The font description should be delimited by double quote (") marks unless the attribute is set to DEFAULT.
; If this attribute is set to DEFAULT, the font specified as the value of the main dialog font will be used. If the main dialog font is set to DEFAULT,
; the system font is used. You do not need to provide any value for this attribute unless you are also specifying text or background color.
; WARNING: If a font is selected that doesn't exist on the user's system, a substitution will be made. We recommend using commonly available fonts.

;    FontName | FontSize | Weight | Face

;~~~~~~~~~~~~~~~~
; FontName
;~~~~~~~~~~~~~~~~
;Name of the font. (i.e. Courier New)  WARNING: If a font is selected that doesn't exist on the user's system, a substitution will be made. We recommend using commonly available fonts.

;~~~~~~~~~~~~~~~~
; FontSize
;~~~~~~~~~~~~~~~~
;Size of the font.  (i.e. 6000)  Larger numbers get you bigger fonts.

;~~~~~~~~~~~~~~~~
; Weight
;~~~~~~~~~~~~~~~~
;Weight of the font in the range 0 through 100. For example, 40 is normal and 70 is bold. If this value is zero, a default weight is used.

;~~~~~~~~~~~~~~~~
; Face
;~~~~~~~~~~~~~~~~
;Pitch and family of the font. (Add desired values)

;The two low-order bits specify the pitch of the font and can be one of the following values.
;Value Pitch
;0 DEFAULT_PITCH
;1 FIXED_PITCH
;2 VARIABLE_PITCH

;Bits 4 through 7 of the member specify the font family and can be one of the following values.
;Value Family
;0 DONTCARE - Don't care or don't know.
;16 ROMAN - Fonts with variable stroke width (proportional) and with serifs. MSÃ,® Serif is an example.
;32 SWISS - Fonts with variable stroke width (proportional) and without serifs. MSÃ,® Sans Serif is an example.
;48 MODERN - Fonts with constant stroke width (monospace), with or without serifs. Monospace fonts are usually modern. Pica, Elite, and CourierNewÃ,® are examples
;64 SCRIPT - Fonts designed to look like handwriting. Script and Cursive are examples.
;80 DECORATIVE - Novelty fonts. Old English is an example.

strFont =  `Modern No. 20|5632|40|18`

dlgMessageFormat=`WWWDLGED,6.2`

dlgMessageCaption = strTitle
dlgMessageX=-1
dlgMessageY=-1
dlgMessageWidth=256
dlgMessageHeight=057
dlgMessageNumControls=003
dlgMessageProcedure=`DEFAULT`
dlgMessageFont = strFont
dlgMessageTextColor=`DEFAULT`
dlgMessageBackground=`DEFAULT,DEFAULT`
dlgMessageConfig=2

dlgMessage001=`079,033,036,012,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",1,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
dlgMessage002=`121,033,036,012,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,4,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
dlgMessage003=`007,013,238,012,VARYTEXT,"VaryText_1",strText,"Vary 1",DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("dlgMessage")
Deana F.
Technical Support
Wilson WindowWare Inc.