Dovrei creare un programma in vb.net che crea delle lettere in formato .rtf , ho utilizzato Streamwriter ed il programma funziona bene ma ho necessità che alcune righe della lettera abbiano font e dimenzione diversa, come posso fare per cambiare il carattere? Allego il codice del programma
Imports System.IO
Public Class Form2
Dim Cr As String
Dim Ot As String
Dim Da As String
Dim go As String
Dim ca As String
Dim la As String
Dim tx As String
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Qualifica.TextChanged
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Nome.TextChanged
End Sub
Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Giorno.TextChanged
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RDBT1.CheckedChanged
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RDBT2.CheckedChanged
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dal.TextChanged
End Sub
Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Al.TextChanged
End Sub
Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RDBT3.CheckedChanged
End Sub
Private Sub TextBox6_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Motivazione.TextChanged
End Sub
Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtSalva.Click
Dim sw As New IO.StreamWriter(SaveFileDialog1.FileName)
sw = File.CreateText(Application.StartupPath & "\Indisponibilità.rtf")
sw.WriteLine()
sw.WriteLine("OGGETTO: PERIODO DI INDISPONIBILITA A DIRIGIRE GARE")
sw.WriteLine()
sw.WriteLine("Io sottoscritto,Qualifica " & Qualifica.Text & " " & Nome.Text)
sw.WriteLine()
sw.WriteLine("Sezione di" & sezione.Text & "e attualmente a disposizione: " & Cr & Ot)
sw.WriteLine()
sw.WriteLine("dichiara la propria INDISPONIBILITA come sotto indicato:")
sw.WriteLine()
sw.WriteLine()
If RDBT1.Checked Then
go = Giorno.Text
sw.WriteLine("NON DISPONIBILE nel giorno " & go)
ElseIf RDBT2.Checked Then
Da = Dal.Text
la = Al.Text
sw.WriteLine("NON DISPONIBILE nel periodo dal " & Da & "al " & la)
ElseIf RDBT3.Checked Then
sw.WriteLine("Come da calendario allegato.")
End If
sw.WriteLine("Motivo dell'indisponibilita: " & Motivazione.Text)
sw.WriteLine()
sw.WriteLine("Colgo l'occasione per porgere distinti saluti")
sw.WriteLine()
sw.WriteLine("Data ____/____/____")
sw.WriteLine()
sw.WriteLine("Firma")
sw.WriteLine("__________________________________________")
sw.Flush()
sw.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtEsci.Click
Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtStampa.Click
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CRA.CheckedChanged
If CRA.Checked Then
Cr = "CRA"
Else
Cr = " "
End If
End Sub
Private Sub OTP_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OTP.CheckedChanged
If OTP.Checked Then
Ot = "OTP"
Else
Ot = " "
End If
End Sub
Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblsezione.Click
End Sub
Private Sub TextBox1_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sezione.TextChanged
End Sub
End Class
Public Class Form2
Dim Cr As String
Dim Ot As String
Dim Da As String
Dim go As String
Dim ca As String
Dim la As String
Dim tx As String
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Qualifica.TextChanged
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Nome.TextChanged
End Sub
Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Giorno.TextChanged
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RDBT1.CheckedChanged
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RDBT2.CheckedChanged
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dal.TextChanged
End Sub
Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Al.TextChanged
End Sub
Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RDBT3.CheckedChanged
End Sub
Private Sub TextBox6_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Motivazione.TextChanged
End Sub
Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtSalva.Click
Dim sw As New IO.StreamWriter(SaveFileDialog1.FileName)
sw = File.CreateText(Application.StartupPath & "\Indisponibilità.rtf")
sw.WriteLine()
sw.WriteLine("OGGETTO: PERIODO DI INDISPONIBILITA A DIRIGIRE GARE")
sw.WriteLine()
sw.WriteLine("Io sottoscritto,Qualifica " & Qualifica.Text & " " & Nome.Text)
sw.WriteLine()
sw.WriteLine("Sezione di" & sezione.Text & "e attualmente a disposizione: " & Cr & Ot)
sw.WriteLine()
sw.WriteLine("dichiara la propria INDISPONIBILITA come sotto indicato:")
sw.WriteLine()
sw.WriteLine()
If RDBT1.Checked Then
go = Giorno.Text
sw.WriteLine("NON DISPONIBILE nel giorno " & go)
ElseIf RDBT2.Checked Then
Da = Dal.Text
la = Al.Text
sw.WriteLine("NON DISPONIBILE nel periodo dal " & Da & "al " & la)
ElseIf RDBT3.Checked Then
sw.WriteLine("Come da calendario allegato.")
End If
sw.WriteLine("Motivo dell'indisponibilita: " & Motivazione.Text)
sw.WriteLine()
sw.WriteLine("Colgo l'occasione per porgere distinti saluti")
sw.WriteLine()
sw.WriteLine("Data ____/____/____")
sw.WriteLine()
sw.WriteLine("Firma")
sw.WriteLine("__________________________________________")
sw.Flush()
sw.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtEsci.Click
Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtStampa.Click
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CRA.CheckedChanged
If CRA.Checked Then
Cr = "CRA"
Else
Cr = " "
End If
End Sub
Private Sub OTP_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OTP.CheckedChanged
If OTP.Checked Then
Ot = "OTP"
Else
Ot = " "
End If
End Sub
Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblsezione.Click
End Sub
Private Sub TextBox1_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sezione.TextChanged
End Sub
End Class
Ringrazio in anticipo per l'aiuto.