Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
Apply stylesettings programatically
posted

I require font to be arial across application,Hence the following done using AppStylist:

<styles>

<style role="Base">

<states>

<state name="Normal" fontName="Arial" fontSize="8.25" themedElementAlpha="Transparent" />

At run time, Iam using DrawFiter on UltraButton: Ex:

drawParams.Graphics.DrawString(_pricePips, new Font("Arial", drawParams.Font.SizeInPoints), brush, 10, 40);

Now i want to replace hard coded Arial from above , located in ISL file.

Is there any class where i can read StyleSettings inside code.

  • 469350
    Verified Answer
    Offline posted

    The DrawFilter's DrawElement method provides you with AppearanceData which contains all the drawing information that the element will use to draw. So you should be able to check the AppearanceData.Font.Name and use that.