< p > ' 
 '   H a v e   y o u   e v e r   w a n t e d   a n   e a s y   w a y   t o   c h a n g e   f o n t s   w i t h i n   a   p r i n t   l i n e 
 '   w h e n   s e n d i n g   o u t p u t   t o   t h e   p r i n t e r ?   I   r e c i e n t l y   h a d   a   r e q u i r e m e n t   t o 
 '   p r i n t   a s c i i   d a t a   w i t h   e m b e d e d   B a r c o d e   o u t p u t   o n   t h e   s a m e   l i n e . 
 '   S i n c e   t h e   o u t p u t   w a s   b e i n g   g e n e r a t e d   f r o m   a   d a t a b a s e   q u e r y ,   i t   m a d e 
 '   s e n s e   t o   f o r m a t   t h e   d a t a   u s i n g   a   p r o p o r t i o n a l   f o n t   ( C o u r i e r   N e w )   t h e n 
 '   c h a n g e   t h e   f o n t   a f t e r   p r i n t i n g   t h e   a s c i i   d a t a .   U n f o r t u n a t l y ,   t h e   p r i n t e r   o b j e c t 
 '   w i l l   o n l y   a l l o w   y o u   t o   s p e c i f y   a   f o n t   f o r   t h e   e n t i r e   l i n e   b e i n g   p r i n t e d . 
 ' 
 '   B e i n g   a n   o l d   f a r t   p r o g r a m m e r   f r o m   w a y   b a c k ,   I   r e m e b e r e d   t h a t   Q - B a s i c   h a d   t h e 
 '   c a p a b i l i t y   t o   s t o p   t h e   p r i n t   h e a d   i f   t h e r e   w a s   a   s e m i c o l o n   " ; "   a f t e r 
 '   t h e   s t a t C o m m a n d 1 _ C l i c k ( ) 
 ' 
 '   S e t   u p   t o   d i s p l a y   t h e   C o m m o n   e m e n t .   I   c o u l d   n o t   f i n d   a   r e f e r e n c e   t o   t h i s   a n y w h e r e   i n   t h e   V B 
 '   d o c u m e n t a t i o n ,   b u t   t r i e d   i t   a n y w a y .   W a l a ,   i t   w o r k s   j u s t   f i n e . 
 ' 
 '   C r e a t e   a   f o r m   a n d   p l a c e   a   c o m m a n d   b u t t o n   a n d   a d d   t h e   C o m m o n   D i a l o g   c o n t r o l   t o 
 '   t h e   f o r m .   T h e n   C u t   a n d   p a s t e   t h i s   c o d e   i n t o   t h e   p r o j e c t . 
 ' 
 '   Y o u   p r o b a b l y   w i l l   n o t   h a v e   t h e   C o d e   3 9   f o n t   b u t   a n y   o t h e r   v a l i d   f o n t   n a m e 
 '   w i l l   w o r k   f i n e . 
 ' 
 P r i v a t e   S u b   C o m m a n d 1 _ C l i c k ( ) 
 ' 
 O n   E r r o r   R e s u m e   N e x t 
 C o m m o n D i a l o g 1 . C a n c e l E r r o r   =   T r u e 
 C o m m o n D i a l o g 1 . S h o w P r i n t e r 
 ' 
 '   c h e c k   f o r   e r r o r s   o r   c a n c e l   s e l e c t e d 
 ' 
 I f   E r r   & l t ; >   0   T h e n 
     M s g B o x   E r r o r ( E r r ) 
     E x i t   S u b 
 E n d   I f 
 ' 
 '   r e s e t   e r r o r   c h e c k i n g 
 ' 
 O n   E r r o r   G o T o   H a v e E r r o r 
 ' 
 '   S e t   t h e   p r i n t e r   f o n t   t o   p r o p o r t i o n a l   f o n t . 
 ' 
 P r i n t e r . F o n t   =   " C o u r i e r   N e w " 
 P r i n t e r . F o n t S i z e   =   1 0 
 ' 
 '   P r i n t   o u t   t h e   A S C I I   T E X T 
 '   N O T E   T H E   S E M I C O L O N   A T   T H E   E N D ! ! ! ! 
 '   T H I S   T E L L S   T H E   P R I N T   M E T H O D   N O T   T O   R E T U R N   T H E   P R I N T E R 
 '   H E A D   F O R   T H E   N E X T   L I N E . 
 ' 
 P r i n t e r . P r i n t   " T h i s   i s   t h e   A s c i i   T e x t   " ; 
 ' 
 '   C H A N G E   T H E   P R I N T E R   F O N T   F O R   U P C   3 9   b a r   c o d e   f o n t 
 ' 
 P r i n t e r . F o n t   =   " C o d e   3 9 " 
 P r i n t e r . F o n t S i z e   =   1 2 
 ' 
 '   p r i n t   o u t   t h e   a s c i i   t e x t   i n   b a r c o d e   f o n t 
 '   N o t i c e   t h e   L e a d i n g   a n d   t r a i l i n g   " * "   t h i s 
 '   t r a n s l a t e s   t o   t h e   s t a r t / e n d   b a r c o d e   c h a r a c t e r 
 '   i n   t h e   C o d e   3 9   f o n t 
 ' 
 P r i n t e r . P r i n t   " * T h i s   i s   B a r   C o d e   T e x t * " 
 ' 
 '   c l o s e   o u t   t h e   p r i n t e r   o b j e c t 
 ' 
 P r i n t e r . E n d D o c 
 E x i t   S u b 
 H a v e E r r o r : 
 M s g B o x   E r r o r ( E r r ) 
 R e s u m e   N e x t 
 
 E n d   S u b 
 
 < / p > 
 