Hi,
I have just built a small application with a form that has one Text Box and
one Check Box and a couple of Command Buttons.
What I am trying to achieve is that if the Text Box has focus and the User
hits the "Enter" button the focus will move to the next Tab item (i.e. the
Check Box). Likewise on the Check Box but obviously if a Command Button has
the focus, it will initiate the Click event
I have set the Forms CancelButton to the button that closes the form and I
have its AcceptButton set to none.
Do I have to trap every keystroke and test for "Enter"? Or is there a
property that I am missing?
Thanks
Doug 7 5711
Hi Ken,
Thanks
That does cause the "Enter" Key to tab but when it is pressed there is an
audible Ding! from the PC similar to an Error Warning Ding!
Doug
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:ue******** ******@tk2msftn gp13.phx.gbl... Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(B yVal sender As Object, ByVal e As System.Windows. Forms.KeyEventA rgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextCo ntrol(Me.Active Control, True, True, True, True)
End If
End Sub Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message news:eY******** *******@TK2MSFT NGP11.phx.gbl.. . Hi, I have just built a small application with a form that has one Text Box
and one Check Box and a couple of Command Buttons.
What I am trying to achieve is that if the Text Box has focus and the User hits the "Enter" button the focus will move to the next Tab item (i.e. the Check Box). Likewise on the Check Box but obviously if a Command Button
has the focus, it will initiate the Click event
I have set the Forms CancelButton to the button that closes the form and I have its AcceptButton set to none.
Do I have to trap every keystroke and test for "Enter"? Or is there a property that I am missing?
Thanks
Doug
Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(B yVal sender As Object, ByVal e As
System.Windows. Forms.KeyEventA rgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextCo ntrol(Me.Active Control, True, True, True, True)
End If
End Sub
Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message
news:eY******** *******@TK2MSFT NGP11.phx.gbl.. .
Hi,
I have just built a small application with a form that has one Text Box and
one Check Box and a couple of Command Buttons.
What I am trying to achieve is that if the Text Box has focus and the User
hits the "Enter" button the focus will move to the next Tab item (i.e. the
Check Box). Likewise on the Check Box but obviously if a Command Button has
the focus, it will initiate the Click event
I have set the Forms CancelButton to the button that closes the form and I
have its AcceptButton set to none.
Do I have to trap every keystroke and test for "Enter"? Or is there a
property that I am missing?
Thanks
Doug
Hi Ken,
Thanks
That does cause the "Enter" Key to tab but when it is pressed there is an
audible Ding! from the PC similar to an Error Warning Ding!
Doug
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:ue******** ******@tk2msftn gp13.phx.gbl... Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(B yVal sender As Object, ByVal e As System.Windows. Forms.KeyEventA rgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextCo ntrol(Me.Active Control, True, True, True, True)
End If
End Sub Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message news:eY******** *******@TK2MSFT NGP11.phx.gbl.. . Hi, I have just built a small application with a form that has one Text Box
and one Check Box and a couple of Command Buttons.
What I am trying to achieve is that if the Text Box has focus and the User hits the "Enter" button the focus will move to the next Tab item (i.e. the Check Box). Likewise on the Check Box but obviously if a Command Button
has the focus, it will initiate the Click event
I have set the Forms CancelButton to the button that closes the form and I have its AcceptButton set to none.
Do I have to trap every keystroke and test for "Enter"? Or is there a property that I am missing?
Thanks
Doug
Doug,
I thought this is once provided by Armin Zingler,
\\\
Private Sub TextBox1_KeyPre ss( _
ByVal sender As Object, _
ByVal e As System.Windows. Forms.KeyPressE ventArgs) _
Handles TextBox1.KeyPre ss
If e.KeyChar = vbCr Then
e.Handled = True
End If
End Sub
///
I hope thie helps?
Cor
"Doug Bell" <dug@bigpond> schreef in bericht
news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. Hi Ken, Thanks That does cause the "Enter" Key to tab but when it is pressed there is an audible Ding! from the PC similar to an Error Warning Ding!
Doug
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message news:ue******** ******@tk2msftn gp13.phx.gbl... Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(B yVal sender As Object, ByVal e As System.Windows. Forms.KeyEventA rgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextCo ntrol(Me.Active Control, True, True, True, True)
End If
End Sub Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message news:eY******** *******@TK2MSFT NGP11.phx.gbl.. . Hi, I have just built a small application with a form that has one Text Box and one Check Box and a couple of Command Buttons.
What I am trying to achieve is that if the Text Box has focus and the User hits the "Enter" button the focus will move to the next Tab item (i.e. the Check Box). Likewise on the Check Box but obviously if a Command Button has the focus, it will initiate the Click event
I have set the Forms CancelButton to the button that closes the form and I have its AcceptButton set to none.
Do I have to trap every keystroke and test for "Enter"? Or is there a property that I am missing?
Thanks
Doug
Thanks Cor,
I added "
Me.SelectNextCo ntrol(Me.Active Control, True, True, True, True)"
and it is working well.
If e.KeyChar = vbCr Then
e.Handled = True
Me.SelectNextCo ntrol(Me.Active Control, True, True, True, True)
End If
Doug
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:u1******** ******@TK2MSFTN GP10.phx.gbl... Doug,
I thought this is once provided by Armin Zingler, \\\ Private Sub TextBox1_KeyPre ss( _ ByVal sender As Object, _ ByVal e As System.Windows. Forms.KeyPressE ventArgs) _ Handles TextBox1.KeyPre ss If e.KeyChar = vbCr Then e.Handled = True End If End Sub ///
I hope thie helps? Cor
"Doug Bell" <dug@bigpond> schreef in bericht news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. Hi Ken, Thanks That does cause the "Enter" Key to tab but when it is pressed there is
an audible Ding! from the PC similar to an Error Warning Ding!
Doug
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message news:ue******** ******@tk2msftn gp13.phx.gbl... Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(B yVal sender As Object, ByVal e As System.Windows. Forms.KeyEventA rgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextCo ntrol(Me.Active Control, True, True, True, True)
End If
End Sub Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message news:eY******** *******@TK2MSFT NGP11.phx.gbl.. . Hi, I have just built a small application with a form that has one Text Box and one Check Box and a couple of Command Buttons.
What I am trying to achieve is that if the Text Box has focus and the User hits the "Enter" button the focus will move to the next Tab item (i.e. the Check Box). Likewise on the Check Box but obviously if a Command Button has the focus, it will initiate the Click event
I have set the Forms CancelButton to the button that closes the form
and I have its AcceptButton set to none.
Do I have to trap every keystroke and test for "Enter"? Or is there a property that I am missing?
Thanks
Doug
Doug,
I thought this is once provided by Armin Zingler,
\\\
Private Sub TextBox1_KeyPre ss( _
ByVal sender As Object, _
ByVal e As System.Windows. Forms.KeyPressE ventArgs) _
Handles TextBox1.KeyPre ss
If e.KeyChar = vbCr Then
e.Handled = True
End If
End Sub
///
I hope thie helps?
Cor
"Doug Bell" <dug@bigpond> schreef in bericht
news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. Hi Ken, Thanks That does cause the "Enter" Key to tab but when it is pressed there is an audible Ding! from the PC similar to an Error Warning Ding!
Doug
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message news:ue******** ******@tk2msftn gp13.phx.gbl... Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(B yVal sender As Object, ByVal e As System.Windows. Forms.KeyEventA rgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextCo ntrol(Me.Active Control, True, True, True, True)
End If
End Sub Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message news:eY******** *******@TK2MSFT NGP11.phx.gbl.. . Hi, I have just built a small application with a form that has one Text Box and one Check Box and a couple of Command Buttons.
What I am trying to achieve is that if the Text Box has focus and the User hits the "Enter" button the focus will move to the next Tab item (i.e. the Check Box). Likewise on the Check Box but obviously if a Command Button has the focus, it will initiate the Click event
I have set the Forms CancelButton to the button that closes the form and I have its AcceptButton set to none.
Do I have to trap every keystroke and test for "Enter"? Or is there a property that I am missing?
Thanks
Doug
Thanks Cor,
I added "
Me.SelectNextCo ntrol(Me.Active Control, True, True, True, True)"
and it is working well.
If e.KeyChar = vbCr Then
e.Handled = True
Me.SelectNextCo ntrol(Me.Active Control, True, True, True, True)
End If
Doug
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:u1******** ******@TK2MSFTN GP10.phx.gbl... Doug,
I thought this is once provided by Armin Zingler, \\\ Private Sub TextBox1_KeyPre ss( _ ByVal sender As Object, _ ByVal e As System.Windows. Forms.KeyPressE ventArgs) _ Handles TextBox1.KeyPre ss If e.KeyChar = vbCr Then e.Handled = True End If End Sub ///
I hope thie helps? Cor
"Doug Bell" <dug@bigpond> schreef in bericht news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. Hi Ken, Thanks That does cause the "Enter" Key to tab but when it is pressed there is
an audible Ding! from the PC similar to an Error Warning Ding!
Doug
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message news:ue******** ******@tk2msftn gp13.phx.gbl... Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(B yVal sender As Object, ByVal e As System.Windows. Forms.KeyEventA rgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextCo ntrol(Me.Active Control, True, True, True, True)
End If
End Sub Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message news:eY******** *******@TK2MSFT NGP11.phx.gbl.. . Hi, I have just built a small application with a form that has one Text Box and one Check Box and a couple of Command Buttons.
What I am trying to achieve is that if the Text Box has focus and the User hits the "Enter" button the focus will move to the next Tab item (i.e. the Check Box). Likewise on the Check Box but obviously if a Command Button has the focus, it will initiate the Click event
I have set the Forms CancelButton to the button that closes the form
and I have its AcceptButton set to none.
Do I have to trap every keystroke and test for "Enter"? Or is there a property that I am missing?
Thanks
Doug
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: EBG |
last post by:
I have a simple email form on my site but getting screwy results because I
know alot of users are hitting "enter" instead of tab when doing the form.
When they hit enter the entire form is submitted whether it's finished or
not.
Is there an easy way to correct this?
My site only cares about IE.
|
by: Byron McClain |
last post by:
.... is being consumed. I added an event handler for the "keypress" event
and my delegate
never gets executed. Why? I am trying to catch the "enter" key pressed
event to prevent
the DataGrid from going to currentRow + 1. Instead I want it to give focus
to the next cell (currentCol + 1) to the
right if not at the end of the row.
Example:
|
by: Dave McCloskey |
last post by:
How can I convert the "Enter" key to a "Tab" so my application will act like
"Tab" has been hit when the "Enter" key has actually been depressed. This
gives type-writer functionality to programs.
I was able to do this very simply in VB6, however, I have not found a method
to do this in .NET.
--
Take Care,
Dave
|
by: ad |
last post by:
The user want to user "Enter" key to jump as "tab" do when editing data in a
dataGrid.
How can to do that?
|
by: Lars Netzel |
last post by:
Hey!
I have tried...(in a datagrid)
e.KeyDate.Return
and
e.KeyDate.TAB
end
e.KeyDate.Enter
| |
by: Doug Bell |
last post by:
Hi,
I have just built a small application with a form that has one Text Box and
one Check Box and a couple of Command Buttons.
What I am trying to achieve is that if the Text Box has focus and the User
hits the "Enter" button the focus will move to the next Tab item (i.e. the
Check Box). Likewise on the Check Box but obviously if a Command Button has
the focus, it will initiate the Click event
I have set the Forms CancelButton to the...
|
by: mdh |
last post by:
I wrote a little insignificant program, to help me write a more
significant one!!...that was supposed to print all Ascii values from 0
to 127:
>>>>
#include <stdio.h>
# define UPPER_LIMT 127
int main (){
|
by: aryayudhi |
last post by:
I have a html page that has javascript that works perfectly in IE, but not in Firefox. The use of this javascript to change "Tab" to "Enter" Button. When we press Tab, it is like when we press Enter button. How to make this script can be run on Firefox?
I would be grateful to anybody who can help me on this, as I have got out of my depth with this problem.
Thanks,
Arya
======== This is the script :
<script language="javascript"...
|
by: pippyn |
last post by:
I'm programming for a CE device with reduced key board, no mouse, and no touch screen. As such, I have to tab from button to button to get the focus on the button i want. Then to invoke the button with focus i have to hit two keys on the key board to send a space in order to "click" the button. I want to just hit one key, the enter key, instead.
So, how do i trap the enter and turn it into a space?
I tried putting the following code in...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |