viewpoint-particle

Author Topic: Changing Message box font  (Read 3378 times)

fhammer

  • Jr. Member
  • **
  • Posts: 56
Changing Message box font
« on: June 13, 2014, 12:23:48 pm »
Is there a way to change the Message box font? Thank you.

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Changing Message box font
« Reply #1 on: June 13, 2014, 01:07:58 pm »
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
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; 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.