[RESOLVED] Textbox highlighted when printing
I am using VB2010, and using the Printform to printing
However the result is one of the TextBox will highlighted when do printing, see below pic.
http://farm7.static.flickr.com/6181/...ac328dd0f8.jpg
I have no idea what causes it. Any expert can help? Thanks a lot.
Re: Textbox highlighted when printing
try this:
vb Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Array.ForEach(Me.Controls.OfType(Of TextBox).ToArray, Sub(tb As TextBox) tb.DeselectAll())
'now print
End Sub
End Class
Re: Textbox highlighted when printing
Thanks Paul, it works..........
Thanks a lot.
Re: [RESOLVED] Textbox highlighted when printing
A TextBox only shows its selection when it has focus, so all you need do is ensure that no TextBox has focus:
vb.net Code:
Me.ActiveControl = Nothing