Hi , i have two form . form 1 and form 2 .
in form1 users can choice fonts with font dialog box
so i saved font dialog box result in nvarchar field .and in form 2 i want to load font setting from Database.
my question is is:
How i can change String type to font and use that .for example change textbox1 font by
sfont
string sfont = "[Font: Name=Tahoma, Size=14.25, Units=3, GdiCharSet=0, GdiVerticalFont=False] ";
Change textbox font by string !
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Marjan Venema16 reputationPosted Apr 25, 2015, 6:29 AM EDT
Akhil GargRank #772 · 3K reputationPosted Apr 25, 2015, 6:42 AM EDT
bita hekmat10 reputationPosted Apr 25, 2015, 7:59 AM EDT
my problem is solved with this code
***************
var cvt = new FontConverter();
Font f = cvt.ConvertFromString(_fontStr) as Font;
textBox1.Font = f;