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) 4 1753
Jeannot wrote:
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)
It doesn't happen that way at all on my machine. I pasted this code, assuming
panelDocument is a Panel control. Works fine, produces a perfectly normal
TextBox, caret behaves as you described for the designer version.
What else are you doing? Somewhere else in your code lies the answer...
Jeannot wrote:
>> What else are you doing? Somewhere else in your code lies the answer...
You are correct that the parent is a Panel.
tb is not referred to anywhere outside of the code you see, except for
setting Top-Left-Width
You are on VS2008, VB, .NET 3.5 ?
Actually I'm on VS2005, VB, .NET 2.0. Can't believe that would make a
difference, though.
It's a mystery. Are you testing this is a small app by itself? It might be worth
it, to help isolate the issue.
On May 23, 10:09 am, "Steve Gerrard" <mynameh...@comcast.netwrote:
Jeannot wrote:
What else are you doing? Somewhere else in your code lies the
answer...
You are correct that the parent is a Panel.
tb is not referred to anywhere outside of the code you see, except for
setting Top-Left-Width
You are on VS2008, VB, .NET 3.5 ?
Actually I'm on VS2005, VB, .NET 2.0. Can't believe that would make a
difference, though.
It's a mystery. Are you testing this is a small app by itself? It might be worth
it, to help isolate the issue.
Okay, problem solved. Thanks for your help Steve.
My problem was self-inflicted during a senior moment.
It is very unlikely that others will see the same problem, so
humiliating myself by describing it would not help anyone.
"Jeannot" wrote:
Okay, problem solved. Thanks for your help Steve.
My problem was self-inflicted during a senior moment.
It is very unlikely that others will see the same problem, so
humiliating myself by describing it would not help anyone.
maybe unlikely, but not impossible. in fact, i have the exact same problem
but i have absolutely no clue how to turn off this feature.
so it would be great if you could please share your solution here.
regards,
vlad This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Paul Gorodyansky |
last post by:
Hi,
Say I have a text in my TEXTAREA box - 01234567890
I want - using script - insert say "abc" in the middle.
Works almost OK in Internet Explorer (with one problem) based on their
example...
|
by: ray well |
last post by:
i have a text box with limited space that gets loaded from database records.
the important info is at the bottom of the text, which requires scrolling to
get to it, which is a pain.
is there a...
|
by: Chien Lau |
last post by:
Hi,
When a user clicks a TextBox on a modal form, the caret immediately
moves to the clicked location within the existing text. On a non-modal form,
the user's TextBox click sets the focus...
|
by: Forconi Boris via .NET 247 |
last post by:
Hi, I'm working on a project in witch I have to list data(products that can be selected with a certain quantity) from anXML document, with key words entered by the user. A Table isdynamically created...
|
by: José Joye |
last post by:
Hello,
I'm playing around with dynamically loading user controls ...and having
problems
I created a really simple userControl (in fact contains a plain text box)
and placed it into the...
|
by: djc |
last post by:
On the page_load event I am querying a database and binding data to some
text boxes, list boxes, and a repeater control. When the page loads it uses
the value of one of the database fields (status)...
|
by: Amelyan |
last post by:
How can I get state of dynamically created controls (RadioButton, CheckBox,
TextBox.Text) on post back when I click submit button?
The only way I know is by traversing Response.Form enumberator;...
|
by: Fool |
last post by:
Hi,
I want a rich textbox that dynamically highlights particular words
immediately after they are typed. Just looking for some general
tips...
I tried putting some code in a sub that handles...
|
by: lolly |
last post by:
hi i recently used a virtual keyboard from www.codeproject.com/jscript/jvk.asp.
However this part of the code
function keyb_callback(ch)
{
var text =...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |