473,386 Members | 1,795 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,386 software developers and data experts.

calling an event?

I have an event on my form which is on the keyup event. In another part of
the form, I want to be able to call that logic. I have tried calling that
even method with passing (null, null) and things worked. But my "spidey
sense" tells me that's not the correct way to do it. Is there a
better/right way to do this?

Thanks.
Nov 17 '05 #1
2 1139
Flip,

Well, it's not completely incorrect, but it's not the right way to do
it. Rather, what you should do is have a method that takes the key that was
pressed (if needed) and then performs the logic. Then, you can call that
method from your event handler, and anywhere else you need. The event
handler typically has a name which doesn't accurately describe what is
happening, and makes the code harder to understand.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Flip" <[remove_me]ph******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I have an event on my form which is on the keyup event. In another part of
the form, I want to be able to call that logic. I have tried calling that
even method with passing (null, null) and things worked. But my "spidey
sense" tells me that's not the correct way to do it. Is there a
better/right way to do this?

Thanks.

Nov 17 '05 #2
Thanks Nicolas for the quick reply.
Hope this helps.

Ya, it does, I need to revisit the code and rework it a bit. Thank you! :>
Nov 17 '05 #3

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

Similar topics

3
by: Yitzhak | last post by:
I am having "Permission denied" error while calling LogEvent method of WScript.Shell component. Basically, ASP page calls Windows Script Host Shell component to log events to the OS Application...
2
by: Andrew Banks | last post by:
I've got the following code as part of a C# web form but am having problems calling a command. I create a dataset and put some data on the screen. This works fine. (relevant sample below) ...
2
by: mark | last post by:
I am developing an application in .Net C# that needs to restore a number of tool windows to some previous location and size. The problem I have is that when I create the form and set the Location...
3
by: NWx | last post by:
Hi, I defined a base class, Panel, based on System.Web.UI.UserControl, as below: Public MustInherit Class Panel Inherits System.Web.UI.UserControl ..... In another module, I want to...
6
by: Marlene Arauz Martin | last post by:
Hello, How's everybody??? I have an aspx. page that is calling an executable,....like this... System.Diagnostics.ProcessStartInfo psi= new System.Diagnostics.ProcessStartInfo();...
12
by: Ron | last post by:
Greetings, I am trying to understand the rational for Raising Events instead of just calling a sub. Could someone explain the difference between the following 2 scenarios? Why would I want to...
3
by: Jason | last post by:
I have an ASP.NET application in which I would like to call my button click event (imgSubmitSearch_Click) on the page load if certain criteria are met. Is this possible? What is the correct...
5
by: Stinky Pete | last post by:
Hi (again) ;-) I'm still very much at the bottom of a steep learning curve with VB, so any and all help is always appreciated. I've found some code to generate the user names who have logged...
1
by: ravikumar2007 | last post by:
I am working with .NET 3.5 framework within an WPF application. I have a windows application where for a textbox, I have defined the lost focus event. I need to call the Focus() method of any other...
9
by: Pubs | last post by:
Hi all, I want to call a function with some intial parameters with in a thread. At the end of the function execution it should return a value to the caller. Caller is outside the thread. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
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,...
0
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...
0
Oralloy
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 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.