2010年1月26日 星期二

Silverlight clipboard and printing testing

Silverlight 4 supports clipboard and printing functions directly, instead of using Windows API.

Regarding to clipboard, Silverlight only provides TEXT copy/paste functions, without IMAGE functions. The usage is as follows:

Clipboard.SetText(TextBox1.Text)


And we could provide the printing function with the following code:

Dim pd As New PrintDocument()
AddHandler pd.PrintPage, AddressOf PrintPage
pd.Print()


Sub PrintPage(ByVal s As Object, ByVal e As PrintPageEventArgs)
e.PageVisual = Chart1 ' LayoutRoot
End Sub


PrintPage function is the event handler of printing.

2010年1月25日 星期一

Test SyntaxHighlighter

  
string s = @"aaa";
messageBox.show(s);


 
dim s as string = "aaa"
messageBox.show(s)