If i simply call
If PrintDialog1.ShowDialog = DialogResult.OK Then
PrintDocument1.Print()
End If
its working fine but if i use this function in another thread then it will shows error
{"External component has thrown an exception."}