473,419 Members | 1,964 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,419 software developers and data experts.

Setting focus to multi-line textbox?

VMI
In my Windows app, if I'm in a multi-line textbox and I'm writing a postal
address (ie. write ist line and press <Enter>, write 2nd line and press
<Enter>, etc...) how can I make sure that the Enter key will ALWAYS make the
cursor jump to the following line in the textbox? For some reason, and this
happens everywhere
except on my development PC, if a user's writing a line and presses the
<Enter> key, the program interprets that as the user pressing another button
in the Form (instead of jumping to the next line of the multi-line textbox).
I think it has something to do with where the focus is on the Form, but as
long as the cursor's on the multi-line, an <Enter> press always has to jump
to the next line. How can i make sure that it always happens?

The worst part is that I can't debug it in my dev PC because it never
happens there.

Thanks.


Nov 16 '05 #1
1 3252
If the form has got an AcceptButton linked to a button, then enter on the
form will cause a button clicked event to be fired on this button, UNLESS
the current focus is sitting in a control which has the "AcceptReturn"
property set to true.

Does your text box have this property set to true?
"VMI" <vo******@yahoo.com> wrote in message
news:Ot**************@TK2MSFTNGP12.phx.gbl...
In my Windows app, if I'm in a multi-line textbox and I'm writing a postal
address (ie. write ist line and press <Enter>, write 2nd line and press
<Enter>, etc...) how can I make sure that the Enter key will ALWAYS make
the
cursor jump to the following line in the textbox? For some reason, and
this
happens everywhere
except on my development PC, if a user's writing a line and presses the
<Enter> key, the program interprets that as the user pressing another
button
in the Form (instead of jumping to the next line of the multi-line
textbox).
I think it has something to do with where the focus is on the Form, but as
long as the cursor's on the multi-line, an <Enter> press always has to
jump
to the next line. How can i make sure that it always happens?

The worst part is that I can't debug it in my dev PC because it never
happens there.

Thanks.

Nov 16 '05 #2

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

Similar topics

20
by: Arne | last post by:
During testing <div style="overflow:auto;"> in CSS I noticed the mousewheel would work in Mozilla only after I made a <a href="#">some text</a> link and clicked on that, within the div. It...
0
by: Bob | last post by:
I have a database to be used in a multi-user environment. Is there a way that within a query (which my forms are based on) I can identify if a record is in currently in use by another user? ...
5
by: Melissa | last post by:
1. Is there a way to programatically remove the focus from the form; ie, so the focus is not on any control on the form? 2. Is there a way to programatically set the focus to the same place as...
2
by: Mystery Man | last post by:
We have an MDI application that is not setting always setting focus to the newly corrected MDI. It is creating the form and it is the topmost but it does not have focus. The code we are using to...
1
by: Jason | last post by:
I have created a c-sharp app that has keyup, keydown events tied to the form. The form also has some other controls, buttons, labels and 1 custom control that I made which inherits from user...
3
by: Steve Yerkes | last post by:
There seems to be way too much confusion over how to set focus on the a field using a field validator. I looked all over the web and found people trying to do this, but not getting anywhere. There...
7
by: Zytan | last post by:
I want to set a control in a form to have the default focus. This is not the accept button -- that's set to a button when is 'clicked' when you press ENTER. I want a textbox to have the focus...
4
by: Jason | last post by:
Hi, Here's the scenario: I have a web application that has window A and window B. A user has both window A and B open - window A is in the foreground and window B is behind it. If the...
3
by: kelvin.koogan | last post by:
I have a number of controls on a tab page. I want to validate them all when the user tries to leave the tab. I then want to highlight the first control which fails validation. How can I do this? I...
5
by: datactrl | last post by:
On firefox multi-tab, I open a window with ref=window.open(). It works. A new window is opened in a new tab. On parent window, there is button doing ref.focus(). But it won't put focus on that new...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.