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 5687
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***@bellsouth.net> wrote in message
news:ue**************@tk2msftngp13.phx.gbl... Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
End If
End Sub Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message news:eY***************@TK2MSFTNGP11.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(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
End If
End Sub
Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message
news:eY***************@TK2MSFTNGP11.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***@bellsouth.net> wrote in message
news:ue**************@tk2msftngp13.phx.gbl... Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
End If
End Sub Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message news:eY***************@TK2MSFTNGP11.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_KeyPress( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) _
Handles TextBox1.KeyPress
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****************@TK2MSFTNGP10.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***@bellsouth.net> wrote in message news:ue**************@tk2msftngp13.phx.gbl... Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
End If
End Sub Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message news:eY***************@TK2MSFTNGP11.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.SelectNextControl(Me.ActiveControl, True, True, True, True)"
and it is working well.
If e.KeyChar = vbCr Then
e.Handled = True
Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
End If
Doug
"Cor Ligthert" <no************@planet.nl> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl... Doug,
I thought this is once provided by Armin Zingler, \\\ Private Sub TextBox1_KeyPress( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.KeyPressEventArgs) _ Handles TextBox1.KeyPress 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****************@TK2MSFTNGP10.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***@bellsouth.net> wrote in message news:ue**************@tk2msftngp13.phx.gbl... Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
End If
End Sub Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message news:eY***************@TK2MSFTNGP11.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_KeyPress( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) _
Handles TextBox1.KeyPress
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****************@TK2MSFTNGP10.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***@bellsouth.net> wrote in message news:ue**************@tk2msftngp13.phx.gbl... Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
End If
End Sub Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message news:eY***************@TK2MSFTNGP11.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.SelectNextControl(Me.ActiveControl, True, True, True, True)"
and it is working well.
If e.KeyChar = vbCr Then
e.Handled = True
Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
End If
Doug
"Cor Ligthert" <no************@planet.nl> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl... Doug,
I thought this is once provided by Armin Zingler, \\\ Private Sub TextBox1_KeyPress( _ ByVal sender As Object, _ ByVal e As System.Windows.Forms.KeyPressEventArgs) _ Handles TextBox1.KeyPress 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****************@TK2MSFTNGP10.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***@bellsouth.net> wrote in message news:ue**************@tk2msftngp13.phx.gbl... Hi,
Set the forms keypreview property to true.
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Me.SelectNextControl(Me.ActiveControl, True, True, True, True)
End If
End Sub Ken
-----------------
"Doug Bell" <dug@bigpond> wrote in message news:eY***************@TK2MSFTNGP11.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...
|
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...
|
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....
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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,...
|
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,...
| |