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.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Changing Font Size & Bold
How do I change the font size and bold property.
here is the code I am using ;
FontSize = 10
Print #1, Tab(4); cmbCustomer; Tab(45); cmbCity; ","; cmbState, vbCrLf,
Print #1, Tab(10); "Notes: "; Note.Text; vbCrLf,
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.
Retain Font Styles When Changing Font Size
March 25, 2008
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
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.
Access|changing Font To Bold Via VBA Code
Hello, I am a student currently learning Microsoft Access. I have no experience with visual basic. I have a form in a access database. I would like one of the field values to be bolded if the value is greater than 500. My code looks like this:
I am using the Onload event in the form properties.
Private Sub Form_Load()
If [TotalPledged] > 500 Then
I am getting an "invalid use of property" error, but I can't figure out how to fix this If i have [TotalPledged].forecolor it works, but not fontbold...
Thanks for your help
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...
| 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...
DataReports: Applying Bold Or Font Size (conditional)
I am trying to apply bold or change the font size when the word OPTION appears in the report textbox called txtDescription. The code does not throw an error but outcome of the report is unchanged.
Any help in this matter would be appreciated!
Dim WithEvents myStdData As StdDataFormat
Dim WithEvents myDescData As StdDataFormat
Dim WithEvents myDescription As StdDataFormat
Private Sub DataReport_Initialize()
Set myStdData = New StdDataFormat
Set myDescData = New StdDataFormat
Set myDescription = New StdDataFormat
mat = myDescription
Private Sub myStdData_Format(ByVal DataValue As StdFormat.StdDataValue)
If DataValue.Value = "0" Then
DataValue = ""
Private Sub myDescData_Format(ByVal DataValue As StdFormat.StdDataValue)
If DataValue.Value = 0 Then
DataValue.Value = "True"
************* This sub is where the problem exists *************************
Private Sub myDescription_Format(ByVal DataValue As StdFormat.StdDataValue)
If InStr(1, DataValue.Value, "OPTION") Then
ld = True
or = vbRed
Printer Font Size Vs Picturebox/form/font Size
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?
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:
Thanks in advance.
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.
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:
ActiveSheet.DropDowns.Add(1305, 52.5, 242.25, 39).Select
.ListFillRange = "$AW$4:$AW$18"
.LinkedCell = "$AX$5"
.DropDownLines = 5
.Display3DShading = False
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
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?
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).
'worksheetName has been previously defined to contain the
'name of the worksheet being handled
fullFilename = ActiveWorkbook.FullName
footerText = fullFilename & "[" & worksheetName & "]"
.LeftFooter = "&""Times New Roman,Regular""&06" & footerText
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?
How To Change The Font Type And Font Size For A Menu Bar?
I meet a problem in my application. How can i change the font type and font size for the menu used in th form? Since my application is run on 1280x1024, it is too small to see the type on the menu bar. Could anyone help me? Very urgent!!! Thanks.
Richtextbox Text Changing Color When Font Size Changes
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.
combo1.listindex = 0
Private Sub Combo1_Click()
RichTextBox1.SelStart = 0
RichTextBox1.SelLength = Len(RichTextBox1.TextRTF)
RichTextBox1.Font.Size = Combo1.Text
Anyone have any ideas why this might be happening ?
Urgent Changing Font Size And Style Programatically
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
Changing Font Size In Text Mode Printing
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
Changing Font Size Of Prompt Message Of Inputbox
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")
!!!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?
Changing Default DC Font To MsFlexGrid.Font.Name
When I need to obtain a font LONG value for a command button, I make the following:
ButtonFont = SendMessage(Command1.hWnd, WM_GETFONT, 0&, 0&)
I need to do the same for a MsFlexGrid and the function returns 0.
In this case, and because I need to change de default Device Context font (SYSTEM) to the MsFlexGrid.Font.Name, I'm unable to change it.
How can this question be solved ?
Thanks in advance
Font Type & Font Size
I was wondering what font type and font size you usually use in your vb projects.
What font size is too small, and what size is too big?
Do you use different fonts in your project? or maybe different font sizes?
As you noticed my question is some kind of a poll, I hope there will be much replies.
Thank you for your time!
Web Font Question: Font Size
has anyone by chance tried to figure out a way to convert font point size to html size?
Like FontSize @ 8 = HTML font size 1???
(I have figured out how to change web page settings on the fly...BG color...text color...link color...ONLY for less complex pages)
Font Size Vs Font Selected?
I'm creating the editing toolbar for a Rich Text Box, and am starting work on the Font selector (combo) & Font Size selector (combo) and was wondering: Is the size dependant on the font chosen or can the font be any size the user chooses?
+--VB Dot Net
+-- Navman GPS Forums @ http://forum.jdmils.com
I am using a generic Word template using bookmarks to mark where I want to put the data. Heres a snippet that might help:
InsertText = lblProject(0).Caption & " " & txtProject(0).Text
oWord.Selection.GoTo what:=wdGoToBookmark, Name:="Title"
The only problem is that I want the label caption to appear bold and the text to appear normal. Because the template is generic I cannot prepopulate any data on the template. I only have three bookmarks the second bookmark inserts all other fields and parses them so they appear line by line. All of them have the caption that I would like to bold mixed in with the text.
I know this can be done with HTML by using tags does anyone know if it can be done using VB 6.0?
What I am trying to do is have the found numbers highlighted in Bold Font
I reckon the command is, Set myRng.Font.Bold = True, but I can’t find where to insert it without changing all of the Range D4:I17 to bold font.
I only want the found numbers in Bold.
What is the correct command and where does it go?.
Private Sub CommandButton1_Click()
Dim myRng As Range
Set myRng = Sheets("Lotto").Range("D4:I17") ‘Block of 1 to 45 numbers
myRng.Font.ColorIndex = 1
Range("B4:B14").ClearContents ‘ To enter 6 drawn Nos. Plus 2
End Sub ‘ supplementary Numbers ‘ Date of Lottery draw at B13
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myRng As Range
Dim c As Range
Dim x As Integer, y As Integer, z As Integer
If Target.Column <> 2 Then Exit Sub
On Error Resume Next
Set myRng = Range("D4:I17") ‘ for the 6 + 2 drawn Numbers & Date
x = Target.Value y = Range("b11").Value ‘Supplementry# 1
z = Range("b12").Value2 ‘Supplementry# 2
For Each c In myRng
If c.Value = y Or c.Value = z Then
c.Font.ColorIndex = 5 ‘ Color dark blue for 2 supps ElseIf c.Value = x Then
c.Font.ColorIndex = 3 ‘ Color Red for 6 Main numbers End If
On Error GoTo 0
Hi did this following code to font the text and label
text2.FontBold = False
Select Case text1
text2.FontBold = True
text2.BackColor = &H80FF80
Label8.FontBold = True
How can we incorparte the following so it fonts even if discrepancy of + or -3 in the figures ie.
If text1 > = text2 - 3 And Text1 < text2 + 3 Then FontBold
I'm a newbie in programming with a small problem. My code below writes one line in the textbox for each sVariable. What I want to accomplish is that the lines for sVariable(1) and sVariable(15) is written with bold font. Can someone help me with that?
for iCount = 1 to 20
sText = sText & sVariable(iCount) & vbCrLf
mlMainTextBox.Text = sText
Font Bold, Name And Borders
I'm working on an application that would export data from MSHFlexgrid to
Excel...it worked (all the formats)at first....I close the excel..then export
again with the same data (even other data)...the formats are gone...what
are supposedly the problems?
The formats that are gone are those in bold...
Here's the code:
Sub FlexGrid_To_Excel(TheForm As Form, _
Optional GridStyle As Integer = 1, Optional WorkSheetName _
Dim TheFlexgrid As MSHFlexGrid
Dim objXL As New Excel.Application
Dim wbXL As New Excel.Workbook
Dim wsXL As New Excel.Worksheet
Dim intRow As Integer ' counter
Dim intCol As Integer ' counter
Set TheFlexgrid = TheForm.MFG1
Dim theRows As Integer
Dim theCols As Integer
theRows = TheFlexgrid.Rows
theCols = TheFlexgrid.Cols
If Not IsObject(objXL) Then
MsgBox "You need Microsoft Excel to use this function", _
vbExclamation, "Print to Excel"
On Error Resume Next
objXL.Visible = True
Set wbXL = objXL.Workbooks.Add
Set wsXL = objXL.ActiveSheet
If Not WorkSheetName = "" Then
.Name = WorkSheetName
For intRow = 1 To theRows
For intCol = 1 To theCols
wsXL.Cells(intRow + 2, intCol).Value = _
.TextMatrix(intRow - 1, intCol - 1) & " "
wsXL.Columns(1).NumberFormat = "mm/dd/yyyy"
wsXL.Range("a3", Right(wsXL.Columns(theCols).AddressLocal, 1) & _
.Font.Name = "Verdana"
.Font.Bold = True
.HorizontalAlignment = xlCenter
.Borders(xlInside).Weight = xlMedium
.Borders(xlEdgeBottom).Weight = xlMedium
.Borders(xlEdgeTop).Weight = xlMedium
.Borders(xlEdgeRight).Weight = xlMedium
.Borders(xlEdgeLeft).Weight = xlMedium
wsXL.Range(Right(wsXL.Columns(theCols).AddressLocal, 1) & 4, _
Right(wsXL.Columns(theCols).AddressLocal, 1) & theRows + 2).Font.Italic = True
wsXL.Range("a" & theRows + 2, Right(wsXL.Columns(theCols).AddressLocal, 1) & _
theRows + 2).Borders(xlEdgeBottom).Weight = xlMedium
For intCol = 1 To theCols
If intCol <> 4 Then
wsXL.Columns(intCol).HorizontalAlignment = xlCenter
wsXL.PageSetup.FitToPagesWide = 1
wsXL.PageSetup.FitToPagesTall = 1
Set wsXL = Nothing
Set wbXL = Nothing
Set objXL = Nothing
Set TheFlexgrid = Nothing
But when I try to rerun my application...the formats came back and the
second time around...gone
I got this code from somewhere...I'm still newb with this...
Listbox Font Bold
i was wondering if anyone new how to make just some of my text in a listbox bold? so if i had this string in my project List1.AddItem "fullyloaded" & " > " & txtMessage.Text fullyload and > would be bold but txtMessage.Text wont be thanks...
Font.Bold In MsgBox
Is there a way to include bold, italic, or underline in a standard MsgBox? I don't want to hassle to make a whole new form to do this, but still, any way to do this?
"Soon I will answer your questions, now you will answer mine..."
Set Font In Bold Or Indented
I just want to put some text in a RichTextBox and set some formats. I've read the VB help files but I'm getting nowhere fast. Where am I going wrong with:
lMarker = Len(rtfPrint.Text)
rtfPrint.SelStart = lMarker
rtfPrint.Font.Bold = True
rtfPrint.Text = "The sky is blue."
rtfPrint.SelLength = Len(rtfPrint.Text) - lMarker
rtfPrint.Font.Bold = True
Set A Contol's Font To Bold
I have a combobox and i want to disable it but I want to set its font to bold
but it didn't work(Combo1.FontBold)
Font Bold Displaying
i would like to display the following string in this manner
Dim strDisp as String
strdisp = "It is Great !"
display should in the following manner
It is Great ! Great !
Text1.text = Strdisp
How to achive the particular display
Make Font Bold In Flexgrid
I think this is an easy one but I can't find the anwer. Suppose I put text into a flexgrid, how can I make it bold at the same time, or chnage the property of the cell or whole row prior to inserting the text
grdPayroll.TextMatrix(GridRow, 4) = "Total Sub Hrs"
Thanks for the help
Listbox Item Bold/Font
Anyone know how to to make a certain item in a listbox bold or maybe a different color?
Thanks in advance!
Listview - Bold Font...with A Twist
I can make the desired item in my listview appear in BOLD font, but I need to do something a little differently if possible.
What I currently have is something like this...
Customer 1 - Activated
What I would like if I can do it, is this...
Customer 1 - Activated
The problem is that the entire string is contained within one ITEM in the listview. Is the easiest solution here to simply create another subitem?
Printing Bold And In Bigger Font
I am using the following print command to bill prints in my
dot matrix printer.The application is similar to cash register printing where i do not wnat form feed to happen.Hence i have used the following print statment given by one friend here.It works fine but i wan`t to print some lines say the shop name and the total bill amount in bold and in bigger font than the ordinary lines
dim p as long
Open "LPT1:" for output as p
print #p, "This is line 1"
print #p, "This is lie 2"
Can anyone help it is very urgent.
Part Of Textbox In Bold Or Other Font
Is it possible to put a part of a text in a textbox in another font or bold or something like that??
I have some sort of search possibility in my app and it would be nice to put the found part of text in another font or so (or something else but it must draw the attention).
Is this possible with a normal textbox?
If not, any ideas? Perhaps another control or so?
I'm using VB6.
Font Color And Bold Text?
I want to make my outlook body text "New Invoice Number".....
font colour = blue and text = bold
How can i edit the line below to make this happen?
olMail.Body = msg & vbCrLf & vbCrLf & "New Invoice Numbers : " & myvar
Set Font Bold On The SSTab Control
Using the SSTab control with 2 tabs (0 and 1), I set the style property to 1 – ssStylePropertyPage. The problem with this is that the selected tab caption text is not displayed as bold.
I tried setting the font to bold first at design time, which didn’t work. Well, it did, in a way, but not what I expected. Then I tried it at run time (SSTabMyTab.Font.Bold = True), and that didn’t work either. Both ways would change the non-selected tab caption text to bold, which is the opposite of what I need.
I know that if I change the property to 0 – ssStyleTabbedDialog, the selected tab caption text is displayed in bold by default. I just don’t like the look and feel of Windows 3.1. Thanks in advance for any help.