473,785 Members | 2,321 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3281
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 "AcceptRetu rn"
property set to true.

Does your text box have this property set to true?
"VMI" <vo******@yahoo .com> wrote in message
news:Ot******** ******@TK2MSFTN GP12.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
12308
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 appears as if Mozilla needs to have the focus set on that div in order for the mousewheel to work. That's all that link does. The mousewheel works perfectly in IE without the link. It scrolls the div even if there is a scrollbar on the page. Is...
0
1547
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? Beyond record locking, I would like this query to actually skip any records currently active,open, or otherwise have focus. Any ideas? Thanks in advance.
5
3784
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 is done when the form opens; ie, the first control in the taborder which is visible, which is enabled and whose tabstop property is True? I have a form with forty two small subforms and I want to code the Enter event of all the subform controls...
2
7406
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 activate the MDI is something like the following: frmTest frm = new frmTest(); frm.MdiParent = this; frm.Show();
1
1900
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 control. My problem is ... When I first start the app all my keyboard events work fine and by doing debugging I can see that my form has the focus. After I click on a button or my custom control the focus is shifted to those controls and the keyup,...
3
8320
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 are a couple of people selling components... but that is not really an option for me... So, I took the plunge and modified the "WebUIValidation.js" file to make it happen... After tracing through file, I figure it out. It was actually pretty...
7
8063
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 when the form is loaded. The textbox cannot be the first in the Tab order, since it's not at the top of the window, and it seems silly to start the tab order at it just to fix this issue. I cannot call control.Focus() from Form1_Load() since...
4
4064
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 user looking at window A clicks the "open window B" link, I want
3
2167
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 try setting focus but something seems to set the focus back to the control which had it before validation. Any ideas? TIA, KK
5
17951
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 window. So how do I set focus on a window in a multi-tab hosting? Jack
0
10162
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6744
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.