473,396 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

TextBox carret not placed correctly

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 appropriately, but fails to set the
caret. How do I correct this behavior? When the user clicks in the midst of
a word within a TextBox, the caret should be placed precisely between the
two characters at the click-point. Any ideas?

Thanks...
Nov 16 '05 #1
1 1665
> 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 appropriately, but fails to set the caret. How do I correct this behavior? When the user clicks in the midst of a word within a TextBox, the caret should be placed precisely between the
two characters at the click-point. Any ideas?


Not only that, but no text in the TextBox can be selected at ALL via
dragging the mouse. Here's the mind-blowingly weird part.

The problem takes place in a non modal form called CustomerProfileForm.
This non modal form is a child form of the main window. The problem goes
away if the form is created like this:

CustomerProfileForm custForm=new CustomerProfileForm();
custForm.Owner=this;
custForm.Show();

The problem APPEARS if the form is created like this:

CustomerProfileForm custForm=new CustomerProfileForm();
custForm.TopLevel=false;
custForm.Parent=WorkPanel;
custForm.BringToFront();

The obvious solution is: Use the first creation method and avoid the
latter. The problem is: If I use the first creation method, I can't force
the CustomerProfileForm to live within the bounds of the top level window.
I'm stumped.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Amil | last post by:
I have code that adds Javascript to a textbox: txtbox.Attributes.Add("onKeyDown", "myJScode"); When I look at the actual source, the JS code is placed inside of a <span> tag directly before...
1
by: Amil | last post by:
I have code that adds Javascript to a textbox: txtbox.Attributes.Add("onKeyDown", "myJScode"); When I look at the actual source, the JS code is placed inside of a <span> tag directly before...
22
by: DraguVaso | last post by:
Hi, For my application I need the following behavior: When I press F4 the cursor has to move to the next line in my multiline textbox which begins with "0". Finding lines starting with 0 isn't...
2
by: Agnes | last post by:
In my Textbox, User will input a date e.g "2004-12-06" How can I check the curosr position if the user use mouse or arrow to move the cursor position in the textbox ? e.g "2004-12-06" if user move...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.