richtext bold, simple question
VB Code:
Private Sub Form_Load()
Cn.Open "DSN=VAATLAB_OLD"
SQL = "SELECT * FROM " & Pub_TestCode & " WHERE refnr = '" & Pub_Refnr & "'"
Debug.Print SQL
Rs.ActiveConnection = Cn
Rs.Source = SQL
Rs.Open
Tekst = "Test: " & Pub_Test & Chr(13) & Chr(10)
Tekst = Tekst & "Patiënt: " & Rs.Fields.Item("patnaam").Value & Chr(9) & Chr(9) & "Adrema: " & Rs.Fields.Item("adrema").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Datum Onderzoek: " & Rs.Fields.Item("datond").Value & Chr(9) & Chr(9) & "refnr: " & Rs.Fields.Item("refnr").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Dienst: " & Rs.Fields.Item("dienst").Value & Chr(9) & Chr(9) & "Verdiep: " & Rs.Fields.Item("verdiep").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Aanvrager: " & Rs.Fields.Item("aanvrager").Value & Chr(13) & Chr(10)
'---------------------------------------------------------------------------------------------------------------------------
Tekst = Tekst & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Illiaca Externa Rechts: " & Rs.Fields.Item("RE_IL_EXT").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Illiaca Externa Links: " & Rs.Fields.Item("LI_IL_EXT").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Femoralis Communis Rechts: " & Rs.Fields.Item("RE_FE_COM").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Femoralis Communis Links: " & Rs.Fields.Item("LI_FE_COM").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Femoralis Superficialis Prox. Rechts: " & Rs.Fields.Item("RE_FE_SUP_PRO").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Femoralis Superficialis Prox. Links: " & Rs.Fields.Item("LI_FE_SUP_PRO").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Femoralis Superficialis Mid. Rechts: " & Rs.Fields.Item("RE_FE_SUP_MID").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Femoralis Superficialis Mid. Links: " & Rs.Fields.Item("LI_FE_SUP_MID").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Femoralis superficialis - Kanaal van Hunter Rechts: " & Rs.Fields.Item("RE_HUNTER").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Femoralis superficialis - Kanaal van Hunter Links: " & Rs.Fields.Item("LI_HUNTER").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Poplitea Rechts: " & Rs.Fields.Item("RE_POP").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Poplitea Links: " & Rs.Fields.Item("LI_POP").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Truncus Tibio-pereonalis Rechts: " & Rs.Fields.Item("RE_TIB_PER").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Truncus Tibio-pereonalis Links: " & Rs.Fields.Item("LI_TIB_PER").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Tibialis Posterior Rechts: " & Rs.Fields.Item("RE_TIB_PO").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Tibialis Posterior Links: " & Rs.Fields.Item("LI_TIB_PO").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Tibialis Dorsalis Rechts: " & Rs.Fields.Item("RE_TIB_DORS").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Arteria Tibialis Dorsalis Links: " & Rs.Fields.Item("LI_TIB_DORS").Value & Chr(13) & Chr(10)
Tekst = Tekst & "Opmerking: " & Rs.Fields.Item("opmerking").Value & Chr(13) & Chr(10)
Tekst = Tekst & "beoordeling: " & Rs.Fields.Item("beoordeling").Value & Chr(13) & Chr(10)
RtxtTekst = Tekst
Cn.Close
End Sub
I’d like to put the titles (like “Patiënt, “Arteria illiaca”, ..) in bold in the richtextbox. What is the best way to do this?
thx in advance
Re: Easier but not reliable
Quote:
Originally posted by DarkX_Greece
Yes i know that sel functions of rich text box are easier and faster than editing the RTF text but it is not reliable, u may have many problems. Try editing the RTF Text as my first example.VBNeo , for color formating your example is very nice but for font formating is not.
Italic: "{\i " & your text here & "\i0}"
Bold: "{\b " & your text here & "\b0}"
Strikethrough: "{\strike " & your text here & "\strike0}"
Underlined: "{\uline " & your text here & "\uline0}"
If so, tell me how to change the size and font of a particular line of text(without peaking in an RTF file) :p
Very easy!!!!!!!!!!!!!!!!!!!!!
Well look at this:
fs16 = Font size 8
fs24 = Font size 12
fs28 = Font size 14
fs32 = Font size 16
fs72 = Font size 36
fs144 = Font size 72
If you can see are double!
Here is an example code
RichTextBox1.TextRTF = RichTextBox1.TextRTF & "{\fs144 Test\cf0\fs24}
This example will show you this:
Test
it has font size 72.
Need more in rich text box? Just send a message
Re: Very easy!!!!!!!!!!!!!!!!!!!!!
Quote:
Originally posted by DarkX_Greece
Well look at this:
fs16 = Font size 8
fs24 = Font size 12
fs28 = Font size 14
fs32 = Font size 16
fs72 = Font size 36
fs144 = Font size 72
If you can see are double!
Here is an example code
RichTextBox1.TextRTF = RichTextBox1.TextRTF & "{\fs144 Test\cf0\fs24}
This example will show you this:
Test
it has font size 72.
Need more in rich text box? Just send a message
hehe, touché - but, it still doesn't change the fact that it's easier for a someone who doesn't know the syntax in his head to make an RTF file and look, than posting here...