-2

I have used DocX library to create a .docx document from text in my TextBoxs. I have a problem that I can't assign size of nullable variable to other variable (only can assign to value)

var infoFormatting = new Formatting();
infoFormatting.Size = txt_Info.Font.Size //txt_Info is a TextBox

How can I solve this problem? Thanks.

1 Answers1

1

How about:

infoFormatting.Size = (double)txt_Info.Font.Size;
Dusan
  • 5,000
  • 6
  • 41
  • 58
  • I tried like that but my programs still have this error: An unhandled exception of type 'System.ArgumentException' occurred in DocX.dll Additional information: Size – Phùng Khánh Hiên May 24 '15 at 14:41