Z
Z.K.
I was going through Charles Petzold's book Programming Windows with C#
and everything was working fine until I tried typing in the
SysInfoPanel.cs program in Chapter 4. The program works fine in my
older Visual Studio 2002, but it gives me an ambiguous error on the
System.Math.Ceiling function in C# 2008 Express.
Error 1 The call is ambiguous between the following methods or
properties: 'System.Math.Ceiling(decimal)' and
'System.Math.Ceiling(double)' C:\Documents and Settings\xxxxxxxx\My
Documents\Visual Studio
2008\Projects\SysInfoPanel\SysInfoPanel\SysInfoPanel.cs 42 18 SysInfoPanel
I even ran the program from the CD with the same results. Why does the
2008 version of C# give me errors and how to fix it so that it works
like it is supposed to?
Z.K.
code:
readonly float cxCol;
readonly int cySpace;
panel.Size = new Size(
(int)Math.Ceiling(cxCol +
SysInfoStrings.MaxValueWidth(grfx, Font)),
(int)Math.Ceiling(cySpace * SysInfoStrings.Count));
and everything was working fine until I tried typing in the
SysInfoPanel.cs program in Chapter 4. The program works fine in my
older Visual Studio 2002, but it gives me an ambiguous error on the
System.Math.Ceiling function in C# 2008 Express.
Error 1 The call is ambiguous between the following methods or
properties: 'System.Math.Ceiling(decimal)' and
'System.Math.Ceiling(double)' C:\Documents and Settings\xxxxxxxx\My
Documents\Visual Studio
2008\Projects\SysInfoPanel\SysInfoPanel\SysInfoPanel.cs 42 18 SysInfoPanel
I even ran the program from the CD with the same results. Why does the
2008 version of C# give me errors and how to fix it so that it works
like it is supposed to?
Z.K.
code:
readonly float cxCol;
readonly int cySpace;
panel.Size = new Size(
(int)Math.Ceiling(cxCol +
SysInfoStrings.MaxValueWidth(grfx, Font)),
(int)Math.Ceiling(cySpace * SysInfoStrings.Count));