You can use negative color for the text:
Color InvertColor(Color sourceColor) {
return Color.FromArgb(255 - sourceColor.R,
255 - sourceColor.G,
255 - sourceColor.B);
}
Any color is guaranteed to be more or less readable on its negative color, so there you go. This is a quick and dirty way to invert a color, you may also want to check the answers for this question: How do I invert a color?
Another option is to add a white halo to the black text. That's what people do in GIS applications to ensure that map labels are readable on top of any surface. The idea of halo effect is to have a thin white border around black text. This way the text is readable whether it's on white background (the border becomes invisible) or on black background (the border outlines the text).
There are multiple tutorials on the topic, like this article or this SO question (with VB.NET sample).
When you have a Color
picked out, just assign it to the ForeColor
property of your textbox like this:
txtColor.ForeColor = mycolor;