.net - How do i specify a bold version of the theme's default font? -


i'm having problems cross theme compatibility in windows forms. if don't set font control on windows form, use system font correct typeface , size. if want make font bold, hard codes in rest of system font values current theme you're programming with. instance:

system::windows::forms::label^ label1 = gcnew system::windows::forms::label();  this->label1->autosize = true; this->label1->location = system::drawing::point(9, 12); this->label1->name = l"lblexample"; this->label1->size = system::drawing::size(44, 13); this->label1->tabindex = 3; this->label1->text = l"example text"; 

if change properties of via properties editor bold = true, adds in line:

this->label1->font = (gcnew system::drawing::font(l"microsoft sans serif", 8.25f, system::drawing::fontstyle::bold, system::drawing::graphicsunit::point, static_cast<system::byte>(0))); 

is there way of using default font, making bold?

further yet, there way of using system font, making size 3 or 4 points larger?

you can put modified font initialization directly after initializecomponent call in constructor.

also, can 1 of many, many constructors change size.

initializecomponent();  label1->font = gcnew system::drawing::font(     label1->font->fontfamily,      label1->font->sizeinpoints + 4,      fontstyle::bold,     graphicsunit::point); 

this keep design view getting confused... won't able see in design view.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -