473,807 Members | 2,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to determin if return was pressed

Dear colleagues

How can I determin if "return button was pressed" in a textbox? I am trying
to di this with this methode:
Private Sub txbInput_KeyDow n(ByVal sender As Object, ByVal e As
System.Windows. Forms.KeyEventA rgs) Handles txbInput.KeyDow n
if (return was pressed then execute the follwoinf call
GetMembers()
end if


End Sub

Thanks ALex
Nov 21 '05 #1
4 1138
Hi,
Try this :

Private Sub txbInput_KeyPre ss(ByVal sender As Object, ByVal e As
KeyPressEventAr gs)
if (e.KeyChar = 13) Then '13 = Ascii code for return
'your code
End If
End Sub
"Alex" <in********@gmx .ch> a écrit dans le message de
news:er******** *****@TK2MSFTNG P12.phx.gbl...
Dear colleagues

How can I determin if "return button was pressed" in a textbox? I am trying to di this with this methode:
Private Sub txbInput_KeyDow n(ByVal sender As Object, ByVal e As
System.Windows. Forms.KeyEventA rgs) Handles txbInput.KeyDow n
if (return was pressed then execute the follwoinf call
GetMembers()
end if


End Sub

Thanks ALex

Nov 21 '05 #2
Thanks a lot !! Alex
"Pierre" <sa****@liberty surf.fr> wrote in message
news:41******** *************** @news.free.fr.. .
Hi,
Try this :

Private Sub txbInput_KeyPre ss(ByVal sender As Object, ByVal e As
KeyPressEventAr gs)
if (e.KeyChar = 13) Then '13 = Ascii code for return
'your code
End If
End Sub
"Alex" <in********@gmx .ch> a écrit dans le message de
news:er******** *****@TK2MSFTNG P12.phx.gbl...
Dear colleagues

How can I determin if "return button was pressed" in a textbox? I am

trying
to di this with this methode:
Private Sub txbInput_KeyDow n(ByVal sender As Object, ByVal e As
System.Windows. Forms.KeyEventA rgs) Handles txbInput.KeyDow n
> if (return was pressed then execute the follwoinf call


GetMembers()
>end if


End Sub

Thanks ALex


Nov 21 '05 #3
you could also use the keydown event

Private Sub TextBox1_KeyDow n(ByVal sender As Object, ByVal e As
System.Windows. Forms.KeyEventA rgs) Handles TextBox1.KeyDow n
If e.KeyCode = Keys.Enter Then
'do stuff
End If
End Sub

grtz Peter
"Alex" <in********@gmx .ch> wrote in message
news:OL******** ******@TK2MSFTN GP15.phx.gbl...
Thanks a lot !! Alex
"Pierre" <sa****@liberty surf.fr> wrote in message
news:41******** *************** @news.free.fr.. .
Hi,
Try this :

Private Sub txbInput_KeyPre ss(ByVal sender As Object, ByVal e As
KeyPressEventAr gs)
if (e.KeyChar = 13) Then '13 = Ascii code for return
'your code
End If
End Sub
"Alex" <in********@gmx .ch> a écrit dans le message de
news:er******** *****@TK2MSFTNG P12.phx.gbl...
Dear colleagues

How can I determin if "return button was pressed" in a textbox? I am

trying
to di this with this methode:
Private Sub txbInput_KeyDow n(ByVal sender As Object, ByVal e As
System.Windows. Forms.KeyEventA rgs) Handles txbInput.KeyDow n

>> if (return was pressed then execute the follwoinf call

GetMembers()

>>end if

End Sub

Thanks ALex



Nov 21 '05 #4
Try this

If Asc(e.KeyChar) = 13 Then
' Return was pressed
End If

Gary

"Alex" <in********@gmx .ch> wrote in message
news:er******** *****@TK2MSFTNG P12.phx.gbl...
Dear colleagues

How can I determin if "return button was pressed" in a textbox? I am trying to di this with this methode:
Private Sub txbInput_KeyDow n(ByVal sender As Object, ByVal e As
System.Windows. Forms.KeyEventA rgs) Handles txbInput.KeyDow n
if (return was pressed then execute the follwoinf call
GetMembers()
end if


End Sub

Thanks ALex

Nov 21 '05 #5

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

Similar topics

1
1361
by: Laurence Nixon | last post by:
Hello all. I am seeking ideas on how to determin a specific value with varied parameters. This will be for students who have taken modules in a course for pre-certification. So it will be like this: StudentA ModuleA + ModuleC + ModuleD + ModuleE = (Completetion of this COURSE1)
0
1347
by: Magnabyte | last post by:
Hello all. I am seeking ideas on how to determin a specific value with varied parameters. This will be for students who have taken modules in a course for pre-certification. So it will be like this: StudentA ModuleA + ModuleC + ModuleD + ModuleE = (Completetion of this COURSE1)
0
1221
by: feng | last post by:
I want to use onunload to capture user's action when he clicks on the "x" button, the close window button on the upper-right corner of the brower window, to close the browser. Here is how I capture the event: <SCRIPT FOR="window" EVENT="onunload"> myScript(); </SCRIPT> While myScript() does get called when "x" gets clicked, it is also get called when the user leaves the current page
1
1764
by: Tancev Sasa | last post by:
I am interesting how to determin is the selected printer a dot-matrix printer or is it a laser printer What property is relevant to detrmin what type is selected printer
2
1862
by: jakobsg | last post by:
Hi. How can I determin the hwaddr or ipaddress of the networkinterface that is used in an outgoing connection? I need a kind of traceroute in python or lowlevel socket function that can help me find out which one of my hosts networkinterfaces that is actually used or going to be used to reach a certain remote host. Can I do this?
10
5540
by: Tim Streater | last post by:
I have a form and a button to submit it. The button is made from: <input type=button onclick='myHandler(this.form);'> This all works fine except that in Safari 2.0.4, the enter/return keys, if pressed, submit the form - bypassing my onclick handler. I can partially fix this with: <form onsubmit='return false;'>
3
1302
by: aProgrammingStudent | last post by:
Here's the deal. I am creating a calculator program using visual studios. I have a much of buttons on my form and I want to be able to determin which button is clicked by the user. Reason: I want to use the Text property of the botton pressed by the user without have to have a click event for each button.
3
2744
by: Z.K. | last post by:
I have a problem trapping the return key. I thought if I added the forms keydown event handler that this would do what I want. It did not even go into the keydown event handler when I pressed return. I have a form and three buttons. I assigned one button to the cancel button and another to the accept button property. But the right button rarely gets activated unless it just happens to have focus. So, I thought maybe I need to trap the...
7
1574
by: Nick | last post by:
Hi there, Is it possible to tell how a WebMethod was invoked? For example I would like to determin if it was invoked via SOAP or HTTP Post. Other than creating 2 methods I am no sure if I can do this. Many thanks for your time. Nick.
0
10372
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...
0
10112
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
9193
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...
1
7650
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 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...
0
6879
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
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
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
3854
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
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.