473,378 Members | 1,592 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,378 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 1547
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.