473,396 Members | 2,021 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,396 software developers and data experts.

How can I call an event procedure

Hi All,
I need to call a text box click event programatically. How would I call the
following event procedure from another procedure within the same form:

Private Sub TextBox2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TextBox2.Click

Thanks in advance.
Roger.
Jul 21 '05 #1
3 1549
Hi Roger,

If you don't use 'sender' or 'e' you can simply do

TextBox2_Click(null, null)

Alternately you can do TextBox2_Click(this, new EventArgs()); // C#

--
Happy Coding!
Morten Wennevik [C# MVP]
Jul 21 '05 #2
On Tue, 26 Oct 2004 13:01:04 -0700, Roger wrote:
Hi All,
I need to call a text box click event programatically. How would I call the
following event procedure from another procedure within the same form:

Private Sub TextBox2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TextBox2.Click

Thanks in advance.
Roger.


The best way is to put the code you need to execute in a separate sub and
then call that sub from both places.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Jul 21 '05 #3
Thanks for your help.
VS.net 2003 said that null is not supported but (this, new eventargs())
works fine.

Thanks again.
Roger.

"Morten Wennevik" wrote:
Hi Roger,

If you don't use 'sender' or 'e' you can simply do

TextBox2_Click(null, null)

Alternately you can do TextBox2_Click(this, new EventArgs()); // C#

--
Happy Coding!
Morten Wennevik [C# MVP]

Jul 21 '05 #4

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

Similar topics

0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
3
by: Melissa | last post by:
What specifically causes the Format event of a report's section to fire? Thanks! Melissa
5
by: Stan Sainte-Rose | last post by:
Hi, How can I call an event from an action. Example, I want to call the datagrid.Double.click event when a button is pressed. Stan.
3
by: Laurence Nuttall | last post by:
How can I call a control procedure call Timer1_Elapsed() I get : Argument not specified for paramter 'e' of Private sub_Timer1_Elapsed(sender as Object, e as System.timers.ElapsedEventArgs)...
4
by: John Wels | last post by:
Hi. How can I call some event in my code. Example: I have declared Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btntest.Click 'Code
3
by: Roger | last post by:
Hi All, I need to call a text box click event programatically. How would I call the following event procedure from another procedure within the same form: Private Sub TextBox2_Click(ByVal sender...
0
by: Mike S | last post by:
I've seen examples of using the CallWindowProc Windows API function to call functions through their addresses in VB6 -- a clever workaround to emulate C-like function pointer semantics. A...
2
by: =?Utf-8?B?Y2xhcmE=?= | last post by:
Hi all, How can an event ( such as button.click) be call in code like any sub? Clara -- thank you so much for your help
1
by: AMD_GAMER | last post by:
Hi, I am trying to print address labels. I have a form which asks for the user to input the first name, middle initial, and last name. On the button click to print the label, I have an event...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
0
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...
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,...

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.