Setting font colour using a menu

thunders

New member
Joined
Mar 23, 2009
Messages
3
Programming Experience
Beginner
Hi people


I'm new to VB.Net and for the home learning college assignment, I am doing I'm creating a Notepad application. However, while I have got most of the stuff I need, what I am looking for is any advice, hints or tips om how to set the font color of the text within my notepad application.

My plan is to use a main menu strip and have a sub-menu called Set Font color, so the user would navigate like is Tools->Set Font Color, then using a colorDialog would select the color, and then type in that color.

Now I have used the ColorDialog so allow the user to set the background of the notepad but couldnt figure out on how to set the text

Any help would be great

Thanks
 
Found a Soultion (I think)

hey guys

After trail and error I would one solution I found was this


ColorDialog1.ShowDialog()
TextBox1.ForeColor = ColorDialog1.Color

If there are any other solutions out there then feel free to post

Thanks

Chris
 
That is the easiest solution, but your missing the return value of the ShowDialog function call, this will tell you if user cancelled the dialog, which means that user do not want to change the color.
 
Cheers for posting John

I dont understand what you mean by the return value of the ShowDialog, Im still pretty new to this

should it have for example " return ColorDialog"
 
Back
Top