473,408 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

return key

Gav
Is there a way that I can control exactly what happens when the user presses
the return key in a TextBox?
Nov 15 '05 #1
6 6099
inherite a class from text box and override the:

protected override bool HandleKeyPress(char ch){

}

Regards

Michael

"Gav" <sp**@spam.com> schrieb im Newsbeitrag
news:Ox**************@TK2MSFTNGP10.phx.gbl...
Is there a way that I can control exactly what happens when the user presses the return key in a TextBox?

Nov 15 '05 #2
Why you have to create a new class for every textbox? Just one, and after
that you can use it for every such a textbox, which Enter key you want to
control.

Sunny
"Gav" <sp**@spam.com> wrote in message
news:OX**************@TK2MSFTNGP10.phx.gbl...
Thanks... it seems a bit long winded to have to create a new class for every TextBox. I have heard of a onenter method of a text box such as

<asp:textbox onfocus='....... onenter=''>

Is this actually available or just pipe dreams

"Michael Daniels" <sp********@spammer.de> wrote in message
news:e%******************@TK2MSFTNGP12.phx.gbl...
inherite a class from text box and override the:

protected override bool HandleKeyPress(char ch){

}

Regards

Michael

"Gav" <sp**@spam.com> schrieb im Newsbeitrag
news:Ox**************@TK2MSFTNGP10.phx.gbl...
Is there a way that I can control exactly what happens when the user

presses
the return key in a TextBox?



Nov 15 '05 #3
Gav
But I want it to do something different depending on which Textbox they
press <enter> in... unless there is a way to pass the controls name with it
also or something like that.

"Sunny" <su******@icebergwireless.com> wrote in message
news:eb**************@TK2MSFTNGP09.phx.gbl...
Why you have to create a new class for every textbox? Just one, and after
that you can use it for every such a textbox, which Enter key you want to
control.

Sunny
"Gav" <sp**@spam.com> wrote in message
news:OX**************@TK2MSFTNGP10.phx.gbl...
Thanks... it seems a bit long winded to have to create a new class for

every
TextBox. I have heard of a onenter method of a text box such as

<asp:textbox onfocus='....... onenter=''>

Is this actually available or just pipe dreams

"Michael Daniels" <sp********@spammer.de> wrote in message
news:e%******************@TK2MSFTNGP12.phx.gbl...
inherite a class from text box and override the:

protected override bool HandleKeyPress(char ch){

}

Regards

Michael

"Gav" <sp**@spam.com> schrieb im Newsbeitrag
news:Ox**************@TK2MSFTNGP10.phx.gbl...
> Is there a way that I can control exactly what happens when the user
presses
> the return key in a TextBox?
>
>



Nov 15 '05 #4
niv
pass the object, accept a sender parameter. Then cast the
object into a textbox and get its name.

hth
niv
-----Original Message-----
But I want it to do something different depending on which Textbox theypress <enter> in... unless there is a way to pass the controls name with italso or something like that.

"Sunny" <su******@icebergwireless.com> wrote in message
news:eb**************@TK2MSFTNGP09.phx.gbl...
Why you have to create a new class for every textbox? Just one, and after that you can use it for every such a textbox, which Enter key you want to control.

Sunny
"Gav" <sp**@spam.com> wrote in message
news:OX**************@TK2MSFTNGP10.phx.gbl...
> Thanks... it seems a bit long winded to have to create a new class for
every
> TextBox. I have heard of a onenter method of a text

box such as >
> <asp:textbox onfocus='....... onenter=''>
>
> Is this actually available or just pipe dreams
>
> "Michael Daniels" <sp********@spammer.de> wrote in message > news:e%******************@TK2MSFTNGP12.phx.gbl...
> > inherite a class from text box and override the:
> >
> > protected override bool HandleKeyPress(char ch){
> >
> > }
> >
> > Regards
> >
> > Michael
> >
> > "Gav" <sp**@spam.com> schrieb im Newsbeitrag
> > news:Ox**************@TK2MSFTNGP10.phx.gbl...
> > > Is there a way that I can control exactly what happens when the user > > presses
> > > the return key in a TextBox?
> > >
> > >
> >
> >
>
>


.

Nov 15 '05 #5
Or, you may create a delegate for the method which will be invoked to do the
actions. and after that what you have to do is only to change where the
delegate points for every textbox you wish to handle.

Sunny
"niv" <ni*@hotmail.com> wrote in message
news:00****************************@phx.gbl...
pass the object, accept a sender parameter. Then cast the
object into a textbox and get its name.

hth
niv
-----Original Message-----
But I want it to do something different depending on

which Textbox they
press <enter> in... unless there is a way to pass the

controls name with it
also or something like that.

"Sunny" <su******@icebergwireless.com> wrote in message
news:eb**************@TK2MSFTNGP09.phx.gbl...
Why you have to create a new class for every textbox? Just one, and after that you can use it for every such a textbox, which Enter key you want to control.

Sunny
"Gav" <sp**@spam.com> wrote in message
news:OX**************@TK2MSFTNGP10.phx.gbl...
> Thanks... it seems a bit long winded to have to create a new class for every
> TextBox. I have heard of a onenter method of a text box such as >
> <asp:textbox onfocus='....... onenter=''>
>
> Is this actually available or just pipe dreams
>
> "Michael Daniels" <sp********@spammer.de> wrote in message > news:e%******************@TK2MSFTNGP12.phx.gbl...
> > inherite a class from text box and override the:
> >
> > protected override bool HandleKeyPress(char ch){
> >
> > }
> >
> > Regards
> >
> > Michael
> >
> > "Gav" <sp**@spam.com> schrieb im Newsbeitrag
> > news:Ox**************@TK2MSFTNGP10.phx.gbl...
> > > Is there a way that I can control exactly what happens when the user > > presses
> > > the return key in a TextBox?
> > >
> > >
> >
> >
>
>

.

Nov 15 '05 #6
Gav
Thanks for the help all

"Sunny" <su******@icebergwireless.com> wrote in message
news:eP**************@TK2MSFTNGP10.phx.gbl...
Or, you may create a delegate for the method which will be invoked to do the actions. and after that what you have to do is only to change where the
delegate points for every textbox you wish to handle.

Sunny
"niv" <ni*@hotmail.com> wrote in message
news:00****************************@phx.gbl...
pass the object, accept a sender parameter. Then cast the
object into a textbox and get its name.

hth
niv
-----Original Message-----
But I want it to do something different depending on

which Textbox they
press <enter> in... unless there is a way to pass the

controls name with it
also or something like that.

"Sunny" <su******@icebergwireless.com> wrote in message
news:eb**************@TK2MSFTNGP09.phx.gbl...
> Why you have to create a new class for every textbox?

Just one, and after
> that you can use it for every such a textbox, which

Enter key you want to
> control.
>
> Sunny
> "Gav" <sp**@spam.com> wrote in message
> news:OX**************@TK2MSFTNGP10.phx.gbl...
> > Thanks... it seems a bit long winded to have to

create a new class for
> every
> > TextBox. I have heard of a onenter method of a text

box such as
> >
> > <asp:textbox onfocus='....... onenter=''>
> >
> > Is this actually available or just pipe dreams
> >
> > "Michael Daniels" <sp********@spammer.de> wrote in

message
> > news:e%******************@TK2MSFTNGP12.phx.gbl...
> > > inherite a class from text box and override the:
> > >
> > > protected override bool HandleKeyPress(char ch){
> > >
> > > }
> > >
> > > Regards
> > >
> > > Michael
> > >
> > > "Gav" <sp**@spam.com> schrieb im Newsbeitrag
> > > news:Ox**************@TK2MSFTNGP10.phx.gbl...
> > > > Is there a way that I can control exactly what

happens when the user
> > > presses
> > > > the return key in a TextBox?
> > > >
> > > >
> > >
> > >
> >
> >
>
>
.


Nov 15 '05 #7

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

Similar topics

3
by: Phil Powell | last post by:
My first time working with a PHP class, and after 6 hours of working out the kinks I am unable to return a value from the class, so now I appeal to the general audience what on earth did I do wrong...
20
by: Jakob Bieling | last post by:
Hi! I am using VC++ 7.1 and have a question about return value optimization. Consider the following code: #include <list> #include <string> struct test {
25
by: cppaddict | last post by:
I'd like to know what goes on under the hood when methods return objects. Eg, I have a simple Point class with two members _x and _y. It's constructor, copy constructor, assignment operator and...
2
by: PengYu.UT | last post by:
I have the following sample program, which can convert function object with 1 argument into function object with 2 arguments. It can also do + between function object of the same type. The last...
2
by: Rhino | last post by:
I am trying to verify that I correctly understand something I saw in the DB2 Information Center. I am running DB2 Personal Edition V8.2.1 on Windows. I came across the following in the Info...
15
by: Greenhorn | last post by:
Hi, when a function doesn't specify a return type ,value what value is returned. In the below programme, the function sample()is returning the value passed to 'k'. sample(int); main() { int...
10
by: Mark Jerde | last post by:
I'm trying to learn the very basics of using an unmanaged C++ DLL from C#. This morning I thought I was getting somewhere, successfully getting back the correct answers to a C++ " int SumArray(int...
12
by: Michael Maes | last post by:
Hello, I have a BaseClass and many Classes which all inherit (directly) from the BaseClass. One of the functions in the BaseClass is to (de)serialize the (inherited) Class to/from disk. ...
3
by: kikazaru | last post by:
Is it possible to return covariant types for virtual methods inherited from a base class using virtual inheritance? I've constructed an example below, which has the following structure: Shape...
6
KoreyAusTex
by: KoreyAusTex | last post by:
If anyone can help me figure out the what the missing return statements are, I think it might be the fact that I need to add a return false in the getValue()? import java.util.*; public class...
0
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
0
BarryA
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...
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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: 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...

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.