我正在将用于多页打印的C#代码转换为F#。有人能告诉我怎么翻译吗?
((IAddChild)page1Content).AddChild(page1)背景:
// printdia = printdialog
// printdoc = printdocument
// create a page
let page1 = new System.Windows.Documents.FixedPage()
page1.Width <- printdoc.DocumentPaginator.PageSize.Width
page1.Height <- printdoc.DocumentPaginator.PageSize.Height
page1.Children.Add(printcanvas) |> ignore
// add the page to the document
let page1Content = new System.Windows.Documents.PageContent()
(*C#*)((IAddChild)page1Content).AddChild(page1)
printdoc.Pages.Add(page1Content) |> ignore
// and print
printdia.PrintDocument(printdoc.DocumentPaginator, ordernr.Text);C#中的原始代码
发布于 2015-05-05 10:28:25
如果page1Content.AddChild(page1)不能工作,请尝试(page1Content :> IAddChild).AddChild(page1)。
https://stackoverflow.com/questions/30050370
复制相似问题