J
Jeannot
VS2008, VB, .NET 3.5
When I create a TextBox in Designer, then at runtime wherever I click,
the caret is placed at the end of the text the box actually contains.
But when I create a TextBox dynamically, the caret stays wherever I
clicked, int he middle of nowhere.
Is this a property that defaults different in Designer or at runtime,
or is it a bug?
My code:
Dim tb As System.Windows.Forms.TextBox = New
System.Windows.Forms.TextBox
tb.Anchor = AnchorStyles.Left Or AnchorStyles.Right Or
AnchorStyles.Top
tb.Multiline = True
tb.Height = 100
tb.Text = "Yo Man"
panelDocument.Controls.Add(tb)
When I create a TextBox in Designer, then at runtime wherever I click,
the caret is placed at the end of the text the box actually contains.
But when I create a TextBox dynamically, the caret stays wherever I
clicked, int he middle of nowhere.
Is this a property that defaults different in Designer or at runtime,
or is it a bug?
My code:
Dim tb As System.Windows.Forms.TextBox = New
System.Windows.Forms.TextBox
tb.Anchor = AnchorStyles.Left Or AnchorStyles.Right Or
AnchorStyles.Top
tb.Multiline = True
tb.Height = 100
tb.Text = "Yo Man"
panelDocument.Controls.Add(tb)