Widget Well-Known Member Licensed User Longtime User Feb 20, 2017 #1 If I have a MaterialIcons label defined with Style as Normal, is it possible to change it to Bold using code? If I try something like this: Code: Copy lblTest.Typeface = lblNormal.Typeface 'lblNormal is Using MaterialIcons Typeface lblTest.TypeFace = Typeface.DEFAULT_BOLD 'This will reset lblTest.Typeface to DEFAULT it will reset the Typeface from MaterialIcons back to Default typeface. Why can't I say: lblTest.Typeface = lblNormal.Typeface.Default_BOLD? The only way I can see to change lblTest.Typeface to Bold using code, is if I already have a separate dummy label that is defined with Typeface = MaterialIcons and is already set to Bold. I don't see any way to do it using code like I can with the Default typeface. I have included a simple test app to demonstrate the problem. TIA Attachments TestTypeFaceBold.Zip TestTypeFaceBold.Zip 8.3 KB · Views: 514
If I have a MaterialIcons label defined with Style as Normal, is it possible to change it to Bold using code? If I try something like this: Code: Copy lblTest.Typeface = lblNormal.Typeface 'lblNormal is Using MaterialIcons Typeface lblTest.TypeFace = Typeface.DEFAULT_BOLD 'This will reset lblTest.Typeface to DEFAULT it will reset the Typeface from MaterialIcons back to Default typeface. Why can't I say: lblTest.Typeface = lblNormal.Typeface.Default_BOLD? The only way I can see to change lblTest.Typeface to Bold using code, is if I already have a separate dummy label that is defined with Typeface = MaterialIcons and is already set to Bold. I don't see any way to do it using code like I can with the Default typeface. I have included a simple test app to demonstrate the problem. TIA
Jeffrey Cameron Well-Known Member Licensed User Longtime User Feb 20, 2017 #2 Will Code: Copy Dim poFnt As Typeface poFnt = Typeface.CreateNew(lblMaterial.Typeface, Typeface.STYLE_BOLD) work for you? Upvote 0
Will Code: Copy Dim poFnt As Typeface poFnt = Typeface.CreateNew(lblMaterial.Typeface, Typeface.STYLE_BOLD) work for you?
Widget Well-Known Member Licensed User Longtime User Feb 20, 2017 #3 Jeffrey Cameron said: Will Code: Copy Dim poFnt As Typeface poFnt = Typeface.CreateNew(lblMaterial.Typeface, Typeface.STYLE_BOLD) work for you? Click to expand... Yes, that works! Thanks. Upvote 0
Jeffrey Cameron said: Will Code: Copy Dim poFnt As Typeface poFnt = Typeface.CreateNew(lblMaterial.Typeface, Typeface.STYLE_BOLD) work for you? Click to expand... Yes, that works! Thanks.