Running example on system with CultureInfo different
than en-US may be the source of troubles. There are
hard-coded values in fields edtLength and edtGrandTotal
with "." as decimal separators. In my country, default
decimal separator is "," so when you click "write"
button on the example form, the exception is thrown
(cite:):
An unhandled exception of type 'System.FormatException'
occurred in mscorlib.dll
Additional information: Input string was not in a
correct format.
(end)
Solution is simple: change constructor from this
public frmTestObj()
{
InitializeComponent();
}
to that
public frmTestObj()
{
InitializeComponent();
this.edtGrandTotal.Text=string.Format("{0:n}",100);
this.edtLength.Text=((decimal)120.23).ToString();
}
if you need more info, you can reach me at:
hubert_galuszka@o2.pl