public FwTextBox()
{
m_innerFwTextBox = new InnerFwTextBox();
if (Application.RenderWithVisualStyles)
DoubleBuffered = true;
HasBorder = true;
Padding = Application.RenderWithVisualStyles ? new Padding(2) : new Padding(1, 2, 1, 1);
m_innerFwTextBox.Dock = DockStyle.Fill;
Controls.Add(m_innerFwTextBox);
// This causes us to get a notification when the string gets changed,
// so we can fire our TextChanged event.
m_sda = m_innerFwTextBox.DataAccess;
m_sda.AddNotification(this);
m_innerFwTextBox.LostFocus += OnInnerTextBoxLostFocus;
m_innerFwTextBox.GotFocus += m_innerFwTextBox_GotFocus;
m_innerFwTextBox.MouseEnter += m_innerFwTextBox_MouseEnter;
m_innerFwTextBox.MouseLeave += m_innerFwTextBox_MouseLeave;
// This makes it, by default if the container's initialization doesn't change it,
// the same default size as a standard text box.
Size = new Size(100, 22);
// And, if not changed, it's background color is white.
BackColor = SystemColors.Window;
// Since the TE team put a limit on the text height based on the control's Font,
// we want a default font size that is big enough never to limit things.
Font = new Font(Font.Name, 100.0f);
// We don't want to auto scale because that messes up selections. You can see this
// by commenting this line. If FwFindReplaceDlg.AutoScaleMode is set to Font the test
// SIL.FieldWorks.FwCoreDlgs.FwFindReplaceDlgTests.ApplyWS_ToSelectedString will
// fail because it didn't make a range selection.
AutoScaleMode = AutoScaleMode.None;
}