Font Dialog Box

Tripic

Member
Joined
Jul 29, 2005
Messages
19
Programming Experience
Beginner
Hello all i am new to vb.net and at that any programing out side of pgp mysql and html. Anyways the problem that i am running into is as follows i have set up a basic socket chat aplication and am now trying to add font options a can get the font Dialog Box to apear but cant seem to get the fontt to apply to my text when i type in the text box any ideas would be greatly apreciated thanks in advance

Tripic
IRC = ucandevelopments.com:9999 #Visual_Basic
 
Ok here we go now it's time to resolve your problem :D

If you alreay decided to go for richtextbox then this is common way to change the font color and style of selected text within:

richTextBox1.Focus()

richTextBox1.SelectionColor = Color.Red 'in your case colordialog's value

richTextBox1.SelectionFont = new Font ("Courier", 10, FontStyle.Bold) 'in your case fontdialog's value

and finally if you want to make it to be permanent font and color you should store the picked values in (i prefer for small data) text file on local machine. Then fetch the value from certain text file in load event and just pass to the richtextbox.

i.e.

onLoad ....
'declare streamreader and readline from the text file passing each value to the new var respectively
'now only add the values to the rtBox
rtb1.Font = myFont 'also for the color
End sub

I hope this helps

Cheers ;)
 
Back
Top