Printing Issues (Need Help Quick)
hey, im trying to print out text in a textbox and im trying to get the colors black,red,green + blue but i got no idea how it can be done. can someone help me.
This is my source code in case you need it to understand:
Private Sub cmdPrint_Click()
Dim msgprompt As String, msgtitle As String 'the check if the user wants to print
Dim msgButtons As Integer, msgresult As Integer
msgprompt = "Are you sure you want to print the text?"
msgButtons = vbYesNo + vbInformation + vbDefaultButton2
msgtitle = "Printing Text"
msgresult = MsgBox(msgprompt, msgButtons, msgtitle)
Select Case msgresult
Case vbYes ' if user wants to print
.FontName = "MS Sans Serif" 'sets font
If num >= 8 Then
.FontSize = num 'sets font size
.FontSize = 12 'default font size
If chkBold.value = 1 Then 'checks the bold setting if its turned on
.FontBold = True
.FontBold = False
If chkItalic.value = 1 Then 'checks the italic setting if its turned on
.FontItalic = True
.FontItalic = False
If chkStr.value = 1 Then 'checks the Strikethu setting if its turned on
.FontStrikethru = True
.FontStrikethru = False
If chkUnder.value = 1 Then 'checks the underline setting if its turned on
.FontUnderline = True
.FontUnderline = False
If chkBlack.value = 1 Then 'prints out the font of user's choosing
.ColorMode = RGB(0, 0, 0)
If chkRed.value = 1 Then 'prints out the font of user's choosing
.ColorMode = 2
If chkBlue.value = 1 Then 'prints out the font of user's choosing
.ColorMode = RGB(21, 7, 151)
If chkGreen.value = 1 Then 'prints out the font of user's choosing
.ColorMode = RGB(20, 124, 62)
Exit Sub 'if user does not want to print then nothing will happen
Try setting the Printer.ForeColor property.
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
i have but it still prints black
Originally Posted by Phil Weber
I'm a lost Kid
.ForeColor followed by .Print works fine with me, but you are not using the ColorMode property correctly. It is an integer: 1 (VbPRCMMonochrome, print b/w only) or 2 (VbPRCMColor: print in color)
"There are two ways to write error-free programs. Only the third one works."
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL