Changing Font Size In Text Mode Printing
Hi guys...
I'm printing from my application in text mode. That is by using API functions such as OpenPrinter, StartDocPrinter, WritePrinter etc. My problem is that I need a better way to set the font size. At the moment I'm Doing it by appending chr$(15), chr$(18) etc before the string to be printed. I just want to know whether there is any other better options to specify the font size.
I'm using VB 6.0 and Windows 98
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Richtextbox Text Changing Color When Font Size Changes
Hello,
I have code to change the font size of the text in my Richtextbox, but when it does change the font size, it also changes the color of whatever the text currently is to black. In other words, if the text is currently red or blue, it will change the text to black.
Code:
combo1.additem "8"
combo1.additem "9"
combo1.additem "10"
combo1.additem "11"
combo1.additem "12"
combo1.listindex = 0
Private Sub Combo1_Click()
RichTextBox1.SelStart = 0
RichTextBox1.SelLength = Len(RichTextBox1.TextRTF)
RichTextBox1.Font.Size = Combo1.Text
End Sub
Anyone have any ideas why this might be happening ?
Thanks...
Changing Textbox Text Font Type/Size, Bold, Italic, Underline And Color
Hi everyone, this is urgent.
I have a textbox where user can type in there. When user select (highlight) the text they can change the font, size, Bold, Italic, Underline and/or color. It should work like in MS Word.
How do I do this? I have a combo box for Fonts, a combo box for Size, and 4 command buttons for B, I, U, and Color.
Please help?
Thanks
Retain Font Styles When Changing Font Size
March 25, 2008
Re: VB6
Hello, everyone. I searched for over two hours for an answer but didn't find a relevant forum example. I am using a richtextbox for my documentation. I made several simple font features such as font sizes and font styles (bold and underline) to the richtextbox. The problem I have is that after I bolded and underlined some of my document text, if I change my document to a different font size, any text that have been bolded or underlined will be undone, so I have to highlight them and bold or underline them again. Does anyone have any advice or any example code to correct it?
The following is a fragment of code in selecting for fontbold and for changing font size:
If Len(Trim(RichTextBox1.SelText)) > 0 Then' For selecting text
RichTextBox1.SelFontSize = 14
End If
RichTextBox1.SelBold = Not (RichTextBox1.SelBold)' For selecting text for bold
RichTextBox1.Font.Size = 14 ' Font size to the whole document or richtextbox
Any advice or help will be greatly appreciated.
Mydanvue
How To Print In Dos Mode And How To Change Font Size ?
I wish to dos mode printing to print bills, (Creating Text file to print). How can i change font size ?
I saw following codes in sample for printing dos mode. Please explain usage of following codes
Print #1, Chr(27) 'purpose ?
Print #1, Chr(12) 'purpose ?
Print #1, particulars; Spc(17 - Len(CStr(particulars))); ' purpose ?
Print #1, vbCr ?
How can i set paper size ?
Senthil kumar.A
Changing Font Size And Bold And Font ???
dim Heading as string
Heading = "I want to Make this sentance Bold and bigger"
how would i go about making this variable bold and changing the font and font size.
thankyou
Changing System Font Size
I need fairly simple, Windows version independant code for a way to check and see if the user is using small fonts on their system or not, storing their current font setting if not, and then switching the system to small (96 dpi) fonts during the program, then switching back to their original font size (if needed) at the end of the program. This is necessary because of the design/layout of the program. A few users are saying the text/items at the corner of the screen are running off the edge when using large fonts.
PS Don't worry; this is not homework or anything like that. It's just sort of urgent for the type of programs I design, and I haven't been able to find answers anywhere.
Feel free if you wish to e-mail help/code to:
der29@mindinfo.com
Thanks in advance.
Kevin
Changing Windows Font Size
I need a programmatical solution for changing the size of the Windows fonts, ie normal, (96 DPI), Large (120 DPI) etc in exactly the same way as you'd get if you were to change it via Display Properties > Appearance > Font Size. Ideally there would be no reboot although I would accept this if there was no other way but what is important is that the user shouldn't need to be a local administrator to carry this out. I just can't find an adequate solution to this anywhere but it must be possible because Windows can do all this!
Any help much appreciated.
Thanks
Changing Font Size && Bold
How do I change the font size and bold property.
here is the code I am using ;
PHP Code:
Print #1,
FontSize = 10
Print #1, Tab(4); cmbCustomer; Tab(45); cmbCity; ","; cmbState, vbCrLf,
Print #1,
Print #1, Tab(10); "Notes: "; Note.Text; vbCrLf,
Changing Font Size In A Combo Box
I've created a combo box in excel with the macro recorder. This is the code that came back:
Sub test1()
ActiveSheet.DropDowns.Add(1305, 52.5, 242.25, 39).Select
With Selection
.ListFillRange = "$AW$4:$AW$18"
.LinkedCell = "$AX$5"
.DropDownLines = 5
.Display3DShading = False
End With
End Sub
This always results in a default font size of 8 for my list. Can anyone tell me how to modify the code above to change the font size to 14? Thanks!
Detecting The Current Font And Font Size On Various Lines In A Rich Text Box.
I have written an editor that uses a rich text box as the main text area.
The editor allows the user to select a font and font size on the toolbar.
My question is, how does one get the combo box text (for both the font and font size) to display the font or font size for the current line of the current character location?
Meaning, if I were to type in two lines, the first line being Arial 12pt, and the second line being Tahoma 14pt, how would I get the program to display the font and font size in the combo boxes?
I know about SelFont, SelStart and such, but I am not selecting any text. I am merely moving the cursor up or down and need to be able to display the font and font size for where the cursor currently is.
Anyone have any ideas?
I thank you in advance.
Detecting Font And Font Size On Various Lines In A Rich Text Box.
I have written a basic editor that uses fonts and such, however when I select a different line (while entering text into the text area of the rich text box), it doesn't display the font or font size for that particular location.
Does anyone have any ideas where I can look to solve this problem?
I thank you in advance for any information you may be able to share with me.
Font Size (and Etc.) Keep Reverting / Changing Back
Hey again,
I'm trying to select a bigger font size for someone vision-impaired but the fonts for the textbox keeps the original font size. Every time I run the program it has reverted back to the smaller font. When I look at the form in design mode, everything looks good and big. When I run the program, it has the smaller default font.
I even just threw a picture control up there with a picture in it, and when I run the program to test, it isn't there either! It's just gone.
What is wrong with this? Why does it look okay in design mode, but reverts back when I run the program?
Changing Font Size For Printer Object
Does anyone know how to change font size in using the Printer object? I have 2 applications, one as a DOS-based Clipper application, the other was the same application but created in VB 6.0. The reports for both applications are printed in a dot-matrix printer. When I print my reports in VB using the Printer.Print command, I get smaller fonts, therefore, more lines are printed on a page when compared to the output of my DOS application. Thanks in advance.
How To Get The Font Name And Font Size Of Header/footer Text?
Hi Everybody
Simple question.
In one of my procedures, I write the VBA Excel code set the text for headers and footer specifying the font name and font size (code line shown below in part).
Code:
'...
'...
'worksheetName has been previously defined to contain the
'name of the worksheet being handled
fullFilename = ActiveWorkbook.FullName
footerText = fullFilename & "[" & worksheetName & "]"
With ActiveSheet.PageSetup
.LeftFooter = "&""Times New Roman,Regular""&06" & footerText
End With
'...
'...
However, when I try to read the same (header/footer text) using code and assign it to a string variable, it actually includes the VBA code referring to the font name and font size as well. This is what I get (the contents of the string variable is shown below).
&"Times New Roman,Regular"&06H:MSOFFICEMY DOCUMENTSCombined National Monthly ReportTest11.xls[SBU - East]
Have a look at all the text prior to "H:..."
But when you see the header/footer content in pagesetup -> headers/footers, you only see the actual text viz :-
"H:MSOFFICEMY DOCUMENTSCombined National Monthly ReportTest11.xls[SBU - East]"
Is there a way to read this actual text only in to a string variable?
Best regards
Deepak Agarwal
Urgent Changing Font Size And Style Programatically
Hi,
We already have a project who's font size is 8. I want to change the
font size and style of allthe forms and controls as well as user controls
programatically instead of manually changing in all forms in design mode
please give some easy method which will not consume more time,thanks in
advance
Changing Font Size Of Prompt Message Of Inputbox
Hi
I found the prompt message of inputbox is very small and dull, just like
the below statement, how can make the prompt message bold and even italic
or larger ?
AA = inputbox ("Please Input the Correct Password")
Printing Problem With Font Size
I tried to print some text to the printer by setting the Font.Name property and Font.Size property. However, in the printout, some text has the given size, while the other prints in 8-point size. I have tried a lot to get rid of this problem but no method works. Please help me out, as it is very very urgent.
Thanks in advance.
NIKHIL.
Not Printing With Proper Font And Size
I am having a problem printing in VB5. Using previous versions of VB I was able to tell the printer what font name and font size and it would consistently print as I wanted. I need to print in Courier New so I can create columnized printouts but in VB5, sometimes the printouts come out right and other times they print in a different font and size. I am using the commands:
Printer.Font.Name="Courier New"
Printer.Font.Size=12
Sometimes if I print 2 or more of the same form, the first prints properly but the others print out in a proportionally spaced font and don't look right. Any suggestions?
!!!Changing The System Font Size Moves The Location Of My Buttons!!! HELP DEMO At 10:00
My program is a picture of a remote and when the buttons are pressed (mouse down) a image of the button pressed down shows up and on mouse up it goes back to normal. I made the buttons with the Image componet from the tool bar. When the system font is changed from small font to lager font the location the buttons are all moved to the right and down a little (both the hotspot and the image). This is visable in VB6 and in the EXE when ran. Any ideas?
Dot Matix Printing Problem (font Size)
I want to increase the FontSize while printing on dotmatrix printer from VB, but i am not increasing the fontsize while printing below code. try to give solution for this.
check the Code below :-
Printer.FontSize = 60
Printer.Font = "Times New Roman"
Printer.FontItalic = True
Printer.FontUnderline = True
Printer.Print
Printer.Print Tab(35); "My Report"
Printer.FontSize = 12
Printer.Font = "Times New Roman"
Printer.FontItalic = False
Printer.FontUnderline = False
Printer.Print
Printer.Print Tab(5); "I am printing some stuff!"
Printer.Print
Printer.Print Tab(5); "Wee"
Printer.EndDoc
from
Sudhakar.
Text Mode Printing
- PRINTING IN VB6 ENVIRONMENT IS IN GRAPHICS MODE
- IT IS DIFFICULT TO PRINT HUGE VOLUME OF PAGES THROUGH A DOT MATRIX PRINTER IN GRAPHICS MODE
- HOW CAN WE PRINT IN TEXT MODE WHICH IS VERY FAST IN VB6 ENVIRONMENT ?
CAN ANY ONE HELP ME ?
Text Mode Printing From VB
hi guys,
i am using VB and CrystelReports as front end tools. when i am printing the reports it is printing in graphis mode b'case we are using windows platform, is there any method to print in text mode (like we are printing from DOS) from windows through VB and Crystal reports.
thanks in advance
murali
Can Any One Help About The Text Mode Printing In VB
can any one help about the text mode printing in VB??
i want to have some com ot component to create text mode printing in VB 6.0 under windows environment.
can any one tell me if it is possible to take text mode printing (as u take early days of WordStar, Lotus or other FoxPro based application).
right now i create text file and print in by one small C++ utitlity to take print out.
thanx in advance
firoz
DX7 DD Text Size/font
Is there a way to change the font and/or size of the text for the .DrawText property? If so, how?
Thanks in advance.
Font Size In Text Box
How can I change the text box size, according to the text written within, at runtime. To allow any size of text to fit the size of the text box.
Or is there a way of restricting the font sizes used from the font commondialog box at runtime.
Thanks
Printer Font Size Vs Picturebox/form/font Size
HI Everibody.
Sorry for my bad English
Why the printer object font size is different as in Picturebox or form font size property?
I copyied in a PictureBox all the properties availabe in the printer object (width, height, scalemode, scalewidth, etc, etc) to simulate a printer object, but the font size in the picturebox is always greater therefore printer.currentX & Y does not match picture1.currentX & Y
Now, how can I configure a picturebox that matches perfectly the printer proportion? I need it to make Preview routine
How can I caculate the correct scale for Picture1?
Get All Text In A RTB To Be One Font And One Size (using .TextRTF)
I'm looking for a way to make sure all the text in my RTB is one font and one size. I was thinking of removing all "f1", "f2", etc. (1 meaning font #1 from the font table) but the "fs24" (font size) could be any number and I don't really want to do a loop of all possible font sizes from 0 - 99.
I guess I could use InStr to find all "fs" and then remove that and any numbers that follow it. I guess I was looking for an easier way to accomplish this. Like maybe just removing the font from the font table? I guess I would still have the problem with "fs" though...
Any thoughts?
FONT SIZE In TOOL TIP TEXT
I've got a MSFLEXGRID on a form...
Where does VB get the FONT SIZE for the TOOL TIP TEXT from?
Are there API calls that will allow me to make the FONT of the TOOL TIP bigger than the font of the MSFLEXGRID itself??
Change Output Text's Font Size
hi all,
i have a problem here.actually im developing a Normalization Tool using Vb 6.0. the main function of this tool is user can draw ERD using drawing toolbar and then this tool will help to narmalized it.for sure,user must input attributes for each entity when drawing ERD.
the entity's name and attribute's name will be appear on the notation of Entity.is it possible if i wan to change the font size of attribute's name?and can give any ideas to do it?
thanks a lots..
Text Size And Font Names In Winspool.drv
hi all
following is the code useing in my application, when i direct the file to be prinited in fast way , its printing correct but i cant able print in bold letters and in different fonts, please help
Option Explicit
Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
Declare Function EndDocPrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
Declare Function EndPagePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
Declare Function GetProfileString Lib "kernel32" Alias "GetProfileStringA" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long) As Long
Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, pDefault As PRINTER_DEFAULTS) As Long
Declare Function StartDocPrinter Lib "winspool.drv" Alias "StartDocPrinterA" (ByVal hPrinter As Long, ByVal level As Long, pDocInfo As DOC_INFO_1) As Long
Declare Function StartPagePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
Declare Function WritePrinter Lib "winspool.drv" (ByVal hPrinter As Long, pBuf As Any, ByVal cdBuf As Long, pcWritten As Long) As Long
Public Const CCHDEVICENAME = 32
Public Const CCHFORMNAME = 32
Type DEVMODE
dmDeviceName As String * CCHDEVICENAME
dmSpecVersion As Integer
dmDriverVersion As Integer
dmSize As Integer
dmDriverExtra As Integer
dmFields As Long
dmOrientation As Integer
dmPaperSize As Integer
dmPaperLength As Integer
dmPaperWidth As Integer
dmScale As Integer
dmCopies As Integer
dmDefaultSource As Integer
dmPrintQuality As Integer
dmColor As Integer
dmDuplex As Integer
dmYResolution As Integer
dmTTOption As Integer
dmCollate As Integer
dmFormName As String * CCHFORMNAME
dmUnusedPadding As Integer
dmBitsPerPel As Integer
dmPelsWidth As Long
dmPelsHeight As Long
dmDisplayFlags As Long
dmDisplayFrequency As Long
End Type
Type PRINTER_DEFAULTS
pDatatype As String
pDevMode As DEVMODE
DesiredAccess As Long
End Type
Type DOC_INFO_1
pDocName As String
pOutputFile As String
pDatatype As String
End Type
Public Sub OpenDocForPrint()
Dim strFileText As String
Dim intFile As Integer
Dim strTextToPrint As String
intFile = FreeFile
On Error GoTo Err_Trap
Open "C:p1" For Input As intFile
Do While Not EOF(intFile)
Line Input #intFile, strFileText
strTextToPrint = strTextToPrint & strFileText & vbCrLf
Loop
Close intFile
strTextToPrint = strTextToPrint & vbFormFeed
Call PrintThatFile(strTextToPrint)
Exit Sub
Err_Trap:
If Err.Number = "75" Then
ElseIf Err.Number = "53" Then
MsgBox "File Not Found", vbOKOnly, "Llamas Rule"
Exit Sub
Else
MsgBox Err.Description, vbOKOnly, Err.Number
End If
End Sub
'Get default printer or use specified printer then spool and print
Public Sub PrintThatFile(strText As String, Optional strPrinter As Variant)
Dim lngPrnHndl As Long
Dim Written As Long
Dim strWrite As String
Dim typDOC As DOC_INFO_1
Dim PrnDef As PRINTER_DEFAULTS
Dim lngCnt As Long
Dim lngFlen As Long
Dim strPrnName As String
Dim strReturn As String
Dim intReturn As Integer
If IsMissing(strPrinter) Then
strReturn = Space(255)
intReturn = GetProfileString("Windows", ByVal "device", "", strReturn, Len(strReturn))
If intReturn Then
strPrnName = UCase(Left(strReturn, InStr(strReturn, ",") - 1))
Else
strPrnName = InputBox("No default Printer Listed, you must provide a Printer name", "Llama Print")
End If
Else
strPrnName = strPrinter
End If
typDOC.pDocName = "Llama Printer"
typDOC.pOutputFile = vbNullString
typDOC.pDatatype = vbNullString
Call OpenPrinter(strPrnName, lngPrnHndl, PrnDef)
Call StartDocPrinter(lngPrnHndl, 1, typDOC)
Call StartPagePrinter(lngPrnHndl)
Call WritePrinter(lngPrnHndl, ByVal strText, Len(strText), Written)
Call EndPagePrinter(lngPrnHndl)
Call EndDocPrinter(lngPrnHndl)
Call ClosePrinter(lngPrnHndl)
End Sub
thanks
parthi
Text Mode Printing On Dotmatrix Printer From Windows
Hi there,
trying to print to a dotmatrix printer from vb6. I want to send in textmode because the printing is fast and economical. Any body know of anycontrol which helps you send printer escape codes to format the data onthe printer.
Need your reply quickly
Thanks
Mahesh Chopda
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
Change Font Size Based On Length Of Text
i want it so that when someone enters something into a text box and push a button the font size of the text is decreased until the whole string is in the textbox and not going outside it.
so say someone enters into a text box "hello my name is blah blah blah"
not all of it will be visible because it goes beyond the length of the text box. i want the program to decrease the size of the text "hello my name is blah blah blah" until it fits into the text box. anyone help me out here ?
Calculating Text Height Based On Font Size
I'm trying to size the height of a rich text box based on how many lines of text will be in the text box. I'm trying to find some way of calculating the expected height of the text as a whole. I was trying to do this by doing a ScaleY(BaseFontSize, vbPoints, vbTwips) * #of lines. This is not working. As I get more lines of text, the box begins to get too small. I already have a functon that determines the #of lines accutately. I am resorting to this method as the richtextbox does not appear to have any type of autosizing. Thanks
Changing Font Properties In Rich Text Box
I am making an application in which the computer will dialog with the user about any problem and the user can answer in "yes" or "no".
I have used rich text box for displaying the conversation. Now i want that whatever questions asked by computer should appear as bold and italic and the answer by user (yes or no) apear in noramal text with a different colour. (like chating software msn or yahoo have different colours for both persons)
How can i change the font proerties at every line. When i used the setfont proerty it change the whole rich text box properties.
Changing Font/color/bold Of Certain Text..
say i have 2 buttons... each button enters text into a textbox... the same textbox... and it adds it all together so there on top of eachother...
like this
-------------------------------------------------------
| Button 1 text |
| Button 2 text |
-------------------------------------------------------
now say i want to change the bold to the button 2 text... and only make that bold.. or change the color... but the button 1 text stays the same... now of course i would set this before i wrote to the textbox.. but any ideas... how i can just change the color to say one line of the textbox instead of the whole textbox...
Zooming/Changing Web Browser Text Font Sze....
Zooming/Changing web browser text font sze....
I saw this done on planetsourcecode.com, but it only had 5 sizes, and didn't change the size very much at all. Is there a better way of doing this that changes the size even more??
Changing The Font Style Of The SELECTED Text Only???
Hi folks,
The following codes changes the style (Bold, italic, underline) of the whole text in the text box. I want to know how to change the style of the selected text only. Your help would be appreciated greatly. Thanks
Regards
Code:
Private Sub mnuFormat_Click()
If Text1.SelText = "" Then
mnuFormatBold.Enabled = False
mnuFormatItalic.Enabled = False
mnuFormatUnderline.Enabled = False
Else
mnuFormatBold.Enabled = True
mnuFormatItalic.Enabled = True
mnuFormatUnderline.Enabled = True
End If
End Sub
Private Sub mnuFormatBold_Click()
If mnuFormatBold.Checked = True And mnuFormatBold.Enabled = True Then
With Text1.Font
.Bold = False
End With
mnuFormatBold.Checked = False 'places an check mark
Else
With Text1.Font
.Bold = True
End With
mnuFormatBold.Checked = True 'removes an check mark
End If
End Sub
Edited by - szewari on 12/25/2003 9:27:08 AM
Changing Font Color Cause Text Box To Flicker
If my rich text box control has more text than can currenlty be dispalyed at one time and I change the font color of all the text in the text box, the rich text box will flicker. If the total text in the rich text box does not fill up the entire rich text box dispaly area, I can change any text font color and I do not get any flicker. Is there any way to prevent this repaint event from occuring?
my code is pretty simple:
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Text1.SelColor = NormalFontColor
Changing Font Color In Rich Text Box
Hi, can u tell me how to change the font color in rich text box control..
I want few
line color to in red
and few in blue
and few in black.
how to get this.
thanks in adv.
venu
|