Skip to content

Commit

Permalink
Avoid nullref when clearing TextBox that has not yet been displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
Latif Khalifa authored and gonzalop committed Oct 25, 2010
1 parent 47a7aa4 commit 4bd17ff
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -667,9 +667,10 @@ internal override void PaintControlBackground (PaintEventArgs pevent)
} else {
document.Empty();

document.SetSelectionToCaret (true);
if (IsHandleCreated)
if (IsHandleCreated) {
document.SetSelectionToCaret (true);
CalculateDocument ();
}
}

OnTextChanged(EventArgs.Empty);
Expand Down

0 comments on commit 4bd17ff

Please sign in to comment.