Error 17 Argument '2': cannot convert from 'System.Web.UI.WebControls.FontSize' to 'float'

Error 17 Argument '2': cannot convert from 'System.Web.UI.WebControls.FontSize' to 'float'

Error 16 The best overloaded method match for 'System.Drawing.Font.Font(string, float, System.Drawing.FontStyle)' has some invalid arguments

Code:

chart.DrawString(Convert.ToString(barValue[i]), new Font("arial", FontSize.Small, FontStyle.Regular), TEXT_COLOR, (columnSpacing + CHART_LEFT_MARGIN), (BMP_HEIGHT - (CHART_BOTTOM_MARGIN - (currentBarHeight - BAR_LABEL_SPACE))));

Any solution?

I would be grateful for any help.

0
atiam
6/5/2008 5:42:43 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

2 Replies
1247 Views

Similar Articles

[PageSpeed] 30

new Font("arial", FontSize.Small, FontStyle.Regular)

it expects that the middle parameter will be a float, not a fontsize. Give it a float value or try to figure out how to convert FontSize.Small into a float. I am not sure how you can do that but thats your problem.

Try Convert.ToFloat(...


Please remember to click "Mark as Answer" on this post if it helped you.
0
keyboardcowboy
6/5/2008 5:48:22 PM

problem solved.. thanks.. i just putted the fontsize in a float value..

chart.DrawString(Convert.ToString(barValue[i]), new Font("arial",8, FontStyle.Regular), TEXT_COLOR, (columnSpacing + CHART_LEFT_MARGIN), (BMP_HEIGHT - (CHART_BOTTOM_MARGIN - (currentBarHeight - BAR_LABEL_SPACE))));

0
atiam
6/5/2008 5:56:15 PM
Reply:

Web resources about - Error 17 Argument '2': cannot convert from 'System.Web.UI.WebControls.FontSize' to 'float' - asp.net.web-forms

Resources last updated: 11/28/2015 1:05:53 AM