Link to home
Start Free TrialLog in
Avatar of elorc
elorcFlag for United States of America

asked on

Inherited richtextbox control keeps defaulting to MS Sans Serif

I've written a custom control in VB.NET 2005 that is based on the RichTextBox. It seems to insist on defaulting to Microsoft Sans Serif 8pt no matter what I do, however. I want it to default to the Arial font, size 10. I've ensured this is set in the control's designer and even in the New() sub of the custom control. I've even gone so far as to explicitly set the font at runtime in the program that is using this control, but it always defaults to Microsoft Sans Serif.

If I use the change font dialog that I built into the control, the font can be changed. It's just that I can't seem to get the default font set properly. Any ideas as to why it's behaving like this?
ASKER CERTIFIED SOLUTION
Avatar of fcoperezhn
fcoperezhn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of elorc

ASKER

Unfortuntely due to the nature of the project I can't post the code. I know that makes it a lot more complicated.

I tried changing the font of the form that the control is on and it had no effect. One thing I didn't try was changing the font of the user control's "form" so I will check that when I get back to my desk.
Avatar of elorc

ASKER

Setting the base font didn't help. After trying everything I could think of, I deleted the control from the form and added it back in. It started working as intended then. I don't understand why it needed to be removed and re-added. Prior to that I had tried cleaning/rebuilding the project, which I imagine would have the same effect.

Anyway, it works now. Thanks for responding.
Avatar of elorc

ASKER

This wasn't the solution to the problem but thank you for responding so quickly with your recommendation!