Raising Events! 
Author Message
 Raising Events!

Hi all,

Is it possible to add an event to a textbox on a form. If I add an event to
a form, can I raise it only with respect to that form?? But I want to add an
event to a form and call that w.r.t a textbox on that form.

How's it possible?Any ideas?

Thanks,
Punit Singh



Sun, 06 Mar 2005 02:24:17 GMT  
 Raising Events!
If I understand you correctly, you'd like to add an event to a textbox?  You
could create a custom control that inherits from TextBox and then add that
new event to the control.  You'd need to provide code that raises that
event.  Can you give an example of what you want to accomplish?


Quote:
> Hi all,

> Is it possible to add an event to a textbox on a form. If I add an event
to
> a form, can I raise it only with respect to that form?? But I want to add
an
> event to a form and call that w.r.t a textbox on that form.

> How's it possible?Any ideas?

> Thanks,
> Punit Singh



Sun, 06 Mar 2005 04:06:42 GMT  
 Raising Events!
Hi Karl,

The overall picture is like this... I will let the user to input in any
unit, then I shall take the data, convert it into my unit, do the
calculation in my unit, change that again to user's unit and display it to
the user.

Actually I am using the textbox1.text in calculation which is done in the
Text_Changed event. Now I am extending my application to work for two units.
I gotta figure out a method to feed my different unit data ( which will be
in textbox1.text now) to my calculation which takes english data.
I thought if I can raise an event before the text_changed event and change
the text1.text value to the english unit, my application will still be able
to give right results even when u input a data in different unit.

Can u help me in what I need to do or have some other approach?

Thanks,
Punit Singh



Quote:
> If I understand you correctly, you'd like to add an event to a textbox?
You
> could create a custom control that inherits from TextBox and then add that
> new event to the control.  You'd need to provide code that raises that
> event.  Can you give an example of what you want to accomplish?



> > Hi all,

> > Is it possible to add an event to a textbox on a form. If I add an event
> to
> > a form, can I raise it only with respect to that form?? But I want to
add
> an
> > event to a form and call that w.r.t a textbox on that form.

> > How's it possible?Any ideas?

> > Thanks,
> > Punit Singh



Sun, 06 Mar 2005 05:33:08 GMT  
 Raising Events!
Hi!

Why dont' you use the Enter event, to catch the text before TextChange
occurs? Ofcourse, it will be called only once... when you enter the textbox.

--
*************************************************************************
"French is the language of love, C# is for everything else..."



Quote:
> Hi Karl,

> The overall picture is like this... I will let the user to input in any
> unit, then I shall take the data, convert it into my unit, do the
> calculation in my unit, change that again to user's unit and display it to
> the user.

> Actually I am using the textbox1.text in calculation which is done in the
> Text_Changed event. Now I am extending my application to work for two
units.
> I gotta figure out a method to feed my different unit data ( which will be
> in textbox1.text now) to my calculation which takes english data.
> I thought if I can raise an event before the text_changed event and change
> the text1.text value to the english unit, my application will still be
able
> to give right results even when u input a data in different unit.

> Can u help me in what I need to do or have some other approach?

> Thanks,
> Punit Singh



> > If I understand you correctly, you'd like to add an event to a textbox?
> You
> > could create a custom control that inherits from TextBox and then add
that
> > new event to the control.  You'd need to provide code that raises that
> > event.  Can you give an example of what you want to accomplish?



> > > Hi all,

> > > Is it possible to add an event to a textbox on a form. If I add an
event
> > to
> > > a form, can I raise it only with respect to that form?? But I want to
> add
> > an
> > > event to a form and call that w.r.t a textbox on that form.

> > > How's it possible?Any ideas?

> > > Thanks,
> > > Punit Singh



Mon, 07 Mar 2005 14:17:23 GMT  
 Raising Events!
I not at all sure what your asking, however you can with the handles
clause you call the same event procedure by two different controls.
Just list both controls in the handles clause.  The reverse is true as
well.  You can assign (for example) the text.click event to as many
event procedures you like.  The major idea here is to use the same
event for both textboxes (you can check which one called it by the
sender object) and share variables by declaring them static.  Good
Luck.


Quote:
> Hi!

> Why dont' you use the Enter event, to catch the text before TextChange
> occurs? Ofcourse, it will be called only once... when you enter the textbox.

> --
> *************************************************************************
> "French is the language of love, C# is for everything else..."




> > Hi Karl,

> > The overall picture is like this... I will let the user to input in any
> > unit, then I shall take the data, convert it into my unit, do the
> > calculation in my unit, change that again to user's unit and display it to
> > the user.

> > Actually I am using the textbox1.text in calculation which is done in the
> > Text_Changed event. Now I am extending my application to work for two
>  units.
> > I gotta figure out a method to feed my different unit data ( which will be
> > in textbox1.text now) to my calculation which takes english data.
> > I thought if I can raise an event before the text_changed event and change
> > the text1.text value to the english unit, my application will still be
>  able
> > to give right results even when u input a data in different unit.

> > Can u help me in what I need to do or have some other approach?

> > Thanks,
> > Punit Singh



> > > If I understand you correctly, you'd like to add an event to a textbox?
>  You
> > > could create a custom control that inherits from TextBox and then add
>  that
> > > new event to the control.  You'd need to provide code that raises that
> > > event.  Can you give an example of what you want to accomplish?



> > > > Hi all,

> > > > Is it possible to add an event to a textbox on a form. If I add an
>  event
>  to
> > > > a form, can I raise it only with respect to that form?? But I want to
>  add
>  an
> > > > event to a form and call that w.r.t a textbox on that form.

> > > > How's it possible?Any ideas?

> > > > Thanks,
> > > > Punit Singh



Tue, 08 Mar 2005 02:14:59 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Raise event does not trigger event at the client

2. Need help with raising event in New() event in a base form

3. Raise Events

4. Sinking Excel raised events cross process

5. AddAdvise in VB doesn't raise event

6. raising events

7. raising events in another class

8. How to raise events in other classes?

9. Forwarding raised event to usercontrol?

10. HELP!!! raising events from a custom control

11. Raising events from a class

12. Tricky One: Raising Events Across Applications

 

 
Powered by phpBB® Forum Software