<TextBox Name="txtInput">
<TextBox.ToolTip>
<ToolTip Name="TestToolTip">
This a test message
</ToolTip>
</TextBox.ToolTip>
private void btnClick_Click_1(object sender, RoutedEventArgs e)
{
txtInput.Focus();
ToolTipTest.IsVisible = true;
}
When the button is clicked the tooltip is shown on the button, I want to simulate putting mouse pointer on the textbox, the toolbox to be shown for the textbox
First of all, you should be using the standard validation for something like what you are doing. From your comment above I can tell that’s what you are doing and you should know that WPF has a really good builtin system for doing exactly what you want without doing it so imperatively (and very reusable).
Here’s an example of a style you can apply to, say, all textboxes when the value the are bound to doesn’t validate (using IDataErrorInfo).
You might also consider a more standard UI that utilizes the adorner layer to put a validation failure indicator next to the control that failed validation. Here’s a sample on that:
http://blogsprajeesh.blogspot.com/2009/03/handling-error-in-wpf-idataerrorinfo.html
Good luck.