Click here to Skip to main content
15,921,660 members
Home / Discussions / C#
   

C#

 
GeneralRe: Dialog Issue Pin
Martin#15-Feb-08 0:55
Martin#15-Feb-08 0:55 
GeneralRe: Dialog Issue Pin
Harvey Saayman15-Feb-08 1:04
Harvey Saayman15-Feb-08 1:04 
GeneralRe: Dialog Issue Pin
Martin#15-Feb-08 1:09
Martin#15-Feb-08 1:09 
GeneralRe: Dialog Issue Pin
Harvey Saayman15-Feb-08 1:11
Harvey Saayman15-Feb-08 1:11 
GeneralRe: Dialog Issue Pin
Martin#15-Feb-08 1:26
Martin#15-Feb-08 1:26 
GeneralRe: Dialog Issue Pin
Harvey Saayman15-Feb-08 1:25
Harvey Saayman15-Feb-08 1:25 
GeneralRe: Dialog Issue Pin
Martin#15-Feb-08 1:33
Martin#15-Feb-08 1:33 
QuestionConverting FontSize into float-value Pin
Brutus14-Feb-08 23:00
Brutus14-Feb-08 23:00 
I'm working with C# in ASP.NET on a custom control that converts strings into images (through httphandler) - that works fine, except for 'FontSize'. First I convert FontSize to a string parameter, but after that I can't find a way to convert it into a float-value (to build a Font). In httphandler:
<br />
    String sFontSize = context.Request.Params.Get("FontSize"); //= "120pt"<br />
    // 1<br />
    int iFontSize = Convert.ToInt32(sFontSize); //=0<br />
    // 2<br />
    float iFontSize = float.Parse(sFontSize); //=FormatException-Error<br />
    // 3<br />
    float iFontSize;<br />
    if (float.TryParse(sFontSize, out iFontSize)) //=false<br />
    // 4<br />
    FontUnitConverter fuc = new FontUnitConverter();<br />
    FontUnit fu= FontUnit.Parse(sFontSize);<br />
    float flt = (float)fuc.ConvertTo(fu, typeof(float)); //=Error<br />
<br />
    // float-value is needed to build font:<br />
    Font fFont = new Font(sFontName, iFontSize);<br />


Anyone any ideas?
Thanx, Brutus
GeneralRe: Converting FontSize into float-value Pin
Christian Graus14-Feb-08 23:16
protectorChristian Graus14-Feb-08 23:16 
GeneralRe: Converting FontSize into float-value Pin
Brutus14-Feb-08 23:45
Brutus14-Feb-08 23:45 
GeneralRe: Converting FontSize into float-value Pin
Mircea Puiu15-Feb-08 0:23
Mircea Puiu15-Feb-08 0:23 
GeneralRe: Converting FontSize into float-value Pin
Brutus15-Feb-08 0:42
Brutus15-Feb-08 0:42 
GeneralRe: Converting FontSize into float-value Pin
Mircea Puiu15-Feb-08 1:41
Mircea Puiu15-Feb-08 1:41 
GeneralRe: Converting FontSize into float-value Pin
Brutus15-Feb-08 2:07
Brutus15-Feb-08 2:07 
GeneralP/Invoke problem in migrating 32 bit to 64bit application! Pin
TaiZhong14-Feb-08 21:50
TaiZhong14-Feb-08 21:50 
GeneralRe: P/Invoke problem in migrating 32 bit to 64bit application! Pin
Mike Dimmick15-Feb-08 0:25
Mike Dimmick15-Feb-08 0:25 
GeneralEquivalent to call in c#.net Pin
pekhaleyogesh14-Feb-08 21:43
pekhaleyogesh14-Feb-08 21:43 
GeneralRe: Equivalent to call in c#.net Pin
Christian Graus14-Feb-08 21:46
protectorChristian Graus14-Feb-08 21:46 
GeneralRe: Equivalent to call in c#.net Pin
pekhaleyogesh14-Feb-08 21:53
pekhaleyogesh14-Feb-08 21:53 
GeneralRe: Equivalent to call in c#.net Pin
Roger Alsing14-Feb-08 21:59
Roger Alsing14-Feb-08 21:59 
GeneralRe: Equivalent to call in c#.net Pin
pekhaleyogesh15-Feb-08 1:07
pekhaleyogesh15-Feb-08 1:07 
GeneralRe: Equivalent to call in c#.net Pin
N a v a n e e t h14-Feb-08 21:46
N a v a n e e t h14-Feb-08 21:46 
GeneralCasting and performance Pin
N a v a n e e t h14-Feb-08 21:33
N a v a n e e t h14-Feb-08 21:33 
Generalprogress help Pin
abcomp0114-Feb-08 21:03
abcomp0114-Feb-08 21:03 
GeneralRe: progress help Pin
Christian Graus14-Feb-08 21:47
protectorChristian Graus14-Feb-08 21:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.