Making a Text Box Form Focusable

I have a dialog box I designed appear when a user needs to enter a UPC. It has some rich text boxes, panels, and one text box. I use the following code to set the IBeam in the text box when the dialog box appears:

public TestScanDialog()
{
InitializeComponent();

// Start cursor in text box
testScanDialogTextBox.Focus();
}

Problem: The IBeam is not appearing in the text box.

More Info: I have checked it to see if it is selectable and focusable and both return False for some reason. Its tab is set to 0 and True and there are no other controls set to TabStop 0.

What gives?

[738 byte] By [JBrown9264] at [2007-12-16]
# 1
Ok I found an option for the form the textbox.

I set:

AutoValidate: EnableAllowFocusChange

This still doesn't seem to help though.

Any ideas?

JBrown9264 at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2
Found the right way to do this:

public TestScanDialog()

{

InitializeComponent();

}

private void TestScanDialog_Load(object sender, EventArgs e)

{

// Start cursor in text box

testScanDialogTextBox.Select();

testScanDialogTextBox.Focus();

}

JBrown9264 at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified