I have an XML file that stores a font name and font size that I retrieve and store into variables of type string.I would be grateful if anyone could help me out with this.Code:string FontName = [ all_the_XML_objects ].Value; string FontSize = [ all_the_XML_objects ].Value; MessageBox.Show(FontName); // Shows Lucida Console MessageBox.Show(FontSize); // Shows 9 System.Drawing.Font newFont = new System.Drawing.Font(FontName, (float) FontSize); // While compiling, the above line gives an error: // Cannot convert type 'string' to 'float'




Reply With Quote