yolanasareth
New member
- Joined
- Nov 30, 2011
- Messages
- 2
- Programming Experience
- Beginner
can anybody help me? i can't convert string to font.
this is my source code..
Try
For Each x As FontFamily In FontFamily.Families
lstFont.Items.Add(x.Name)
Next
lstFont.SelectedItem = "Times New Roman"
LstSize.SelectedIndex = 6
Catch ex As Exception
End Try
Private Sub lstFont_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstFont.SelectedIndexChanged //LIST FONT
txtServeSend.Font = New System.Drawing.Font(lstFont.SelectedItem.ToString, 12, FontStyle.Regular)
End Sub
Private Sub LstSize_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles LstSize.SelectedIndexChanged //LIST SIZE
txtServeSend.Font = New System.Drawing.Font(lstFont.SelectedItem.ToString, LstSize.SelectedItem, FontStyle.Regular)
End Sub
when i set font in textbox success but i want to display in richtextbox.
error list : value of type 'system.drawing.font' cannot be converted to string.
anybody help me? thank you
this is my source code..
Try
For Each x As FontFamily In FontFamily.Families
lstFont.Items.Add(x.Name)
Next
lstFont.SelectedItem = "Times New Roman"
LstSize.SelectedIndex = 6
Catch ex As Exception
End Try
Private Sub lstFont_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstFont.SelectedIndexChanged //LIST FONT
txtServeSend.Font = New System.Drawing.Font(lstFont.SelectedItem.ToString, 12, FontStyle.Regular)
End Sub
Private Sub LstSize_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles LstSize.SelectedIndexChanged //LIST SIZE
txtServeSend.Font = New System.Drawing.Font(lstFont.SelectedItem.ToString, LstSize.SelectedItem, FontStyle.Regular)
End Sub
when i set font in textbox success but i want to display in richtextbox.
error list : value of type 'system.drawing.font' cannot be converted to string.
anybody help me? thank you