I'm creating a WPF 'Button' control and making it the child of my ElementHost control.
The background of the button is set to Red.
When I run my project, the button changes colour and it seems to loop through every couple of seconds going from Red to a light blue and back again.. until the Form loses focus.
If I hover over the button, it turns blue, then when I move off the button it starts this colour looping again.. my code is as simple as..
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
System.Windows.Controls.Button but = new System.Windows.Controls.Button();
but.Background = System.Windows.Media.Brushes.Red;
elementHost1.Child = but;
}
}
Is this normal ? can I turn it off?