Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

TextBox carret not placed correctly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chien Lau - 02 Sep 2004 21:50 GMT
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...
Chien Lau - 02 Sep 2004 22:11 GMT
> Hi,
>
[quoted text clipped - 4 lines]
> 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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.