473,473 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Trap ENTER in textbox with an Accept Button set

Hello everyone,

I would like to trap the ENTER key press in a RichTextBox, when it is
in focus. I have an Accept Button set, which grabs it. In Win32, I
could use the WM_GETDLGCODE Notification to accomplish this, but I am
unsure where that functionality exists in VB .NET. Handling the
KeyPress event doesn't work, as it doesn't even get a chance to be run
-- the Accept Button grabs it first.

Any sources of information would be appreciated. But, I'll continue
searching until then...

Thanks,

Zytan.

Jan 29 '07 #1
2 6982
Basically, I want to be able to TYPE in a textbox or RichTextBox,
using TAB and ENTER, while also having an Accept Button, and have
normal TAB behaviour for the rest of the dialog.

Any thoughts?

Zytan

Jan 31 '07 #2
I figured this out.

RichTextBox1.AcceptsTab = True

Other controls have AcceptsTab and AcceptsReturn, but the RichTextBox
control is special... AcceptsTabs means both TAB and ENTER.

Zytan

Feb 9 '07 #3

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

Similar topics

2
by: Phillip Kennedy | last post by:
Hi, HELP!!!! we are having a problem where we have a web page with a number of buttons and form fields, unfortunately whenevr we hit the enter key in a form field it is envokingthe 1st button,...
6
by: André Almeida Maldonado | last post by:
Hey guys... In my aspx page I have a textbox that when the user press Return I need to click a button. How can I do it??? OR All the pages that contains buttons have a default button, but I...
1
by: Agnes | last post by:
I got form A which inhertied from frmBASE Todays, i had re-arrange our usercontrol or other class library. (re-build them) suddenly, i found all some forms 's textbox and button disappear in...
2
by: R Tipton | last post by:
I have a simple web form with a textbox and a button and further down another textbox and button. My problem is even though I have my cursor placed in the second textbox, the first button is...
3
by: David Lozzi | last post by:
Howdy, I'm using asp.net 2.0 and am trying to get one text box on the page, after the user presses enter, to "click" a specific button. I copied the javascript I used for a .net 1.1 web app I...
4
by: peerraghu | last post by:
hi I am creating travels project, in left part of my datagrid of my default page i placed all the products such as india tour ,world tour etc and if v click any product it will redirect to...
6
by: krishnaneeraja | last post by:
Hi, Iam developing windows application using vb.net with c#.net.In this i want to validate textbox accept only negative float numbers like -2.3 etc.... please help me.
1
by: maheswaran | last post by:
Hi friends, I have the registration form with terms and policy. The terms and policy is putted in textarea and need to scroll down the textarea to see the full text. What i need is only user can...
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
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,...
1
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...
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...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.