Jump to content

question TextStyle, Brushes, and colors


George

Recommended Posts

Hey there. I am completely new to this kind of stuff so bare with me I am trying to make a effort in learning though. 

 

that being said, I am confused on how TextStyle and Brushes work. For example I have this code below which works fine!

public readonly Style BrownStyle = new TextStyle(Brushes.Brown, null, FontStyle.Italic);
   

The problem is that I want to use a custom Argb code instead of standard colors.

I experimented with SolidBrush but it didn't give the desired effect. My question is can I use TextStyle, and still use Argb codes if so how would I go about doing this?

 

(edit)

Also the code below is the result from experimenting with SolidBrush, it worked fine as well however it bugged out the rest of my code with "Cannot Implicitly Convert Type" Which is caused by me using "Style" Throughout my code.

     public readonly SolidBrush BrownStyle= new SolidBrush(Color.FromArgb(255, 255, 255, 255));
   

@jcsnider @Kibbelz

Link to comment
Share on other sites

Okay, I'm not going to tell you the answer since you will not learn from it. Instead I will tell you an easy way to find the answer on your own for future issues. Many core functions in .NET have duplicates with different parameters, by opening the brackets of said function a small window will appear saying what the function does and the required parameters. There are little scroll bars so shift between which function with said parameters is ideal for you.

 

I hope this helps and is understandable, I never claim to be good at explaining things :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...