473,396 Members | 2,011 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.

Calling Event Procedures

I want to cause a click event to occur on a Button control when the user
presses enter when the focus is on another control. In VB6, I would just
call the event procedure directly from the other control. However, in
VB.net, that doesn't seem to work. Can someone give me any idea of how to
do this?

Bob
Nov 21 '05 #1
6 3777
Try cmdButton.PerformClick()

[]s
Cesar
"Robert Boudra" <rb*****@comcast.net> escreveu na mensagem
news:%2***************@TK2MSFTNGP15.phx.gbl...
I want to cause a click event to occur on a Button control when the user
presses enter when the focus is on another control. In VB6, I would just
call the event procedure directly from the other control. However, in
VB.net, that doesn't seem to work. Can someone give me any idea of how to
do this?

Bob

Nov 21 '05 #2
Bob,
I want to cause a click event to occur on a Button control when the user
presses enter when the focus is on another control. In VB6, I would just
call the event procedure directly from the other control. However, in
VB.net, that doesn't seem to work. Can someone give me any idea of how to
do this?

\\\
me.button_clickEvent(sender, nothing)
or for some who find that nicer if possible because that the same
eventargument is used
me.button_clickEvent(sender,e)
///

(This needeless text above because I normally get a message from Herfried
about this)

I use normally
\\\
me.button_clickEvent(nothing,nothing)
///
if I don't need the sender or the eventargument.

I don't use perform.click because that only works if the button is visible
and for that I don't want to check my program everytime by a change.

I hope this helps,

Cor
Nov 21 '05 #3
"Robert Boudra" <rb*****@comcast.net> schrieb:
I want to cause a click event to occur on a Button control when the user
presses enter when the focus is on another control. In VB6, I would just
call the event procedure directly from the other control. However, in
VB.net, that doesn't seem to work. Can someone give me any idea of how to
do this?


See:

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/7f99b7d181575b20>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
Cor Ligthert [MVP] wrote:
se normally
\\\
me.button_clickEvent(nothing,nothing)
///


What happens if the click event it wired to more than one button?
Passing Nothing into the sender property will prevent the code from
knowing which Button was clicked.

In my opinion, a better solution is to place to code that is executed
by the button click in a separate sub routine and call that directly
instead of calling the event procedure.

Nov 21 '05 #5
Chris in my message is

"if I don't need the sender or the eventargument".

Otherwise

me.button_clickEvent(sender,nothing)

Although your methode suits as well, a matter of preference.

Cor
Nov 21 '05 #6
Cor Ligthert [MVP] wrote:
Chris in my message is

"if I don't need the sender or the eventargument".


Doh! I missed that.

Nov 21 '05 #7

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

Similar topics

1
by: Robert Scheer | last post by:
Hi. I wrote some stored procedures used by a web application. As I am fairly new to Oracle, I am missing some concepts when creating these procedures, as a result, the application is suffering...
1
by: ZeBerg | last post by:
Is it possible to have a stored procedure in database A while calling it from database B and have it manipulate the tables in database B (whatever the calling database happens to be)? We have a...
4
by: Corepaul | last post by:
I am a newbie using Access 2000. I am using the following test in the txtAlbum OnExit procedure to prevent leaving an empty text box for a required field If (IsNull(txtAlbum.Value)) Or...
14
by: jj | last post by:
Is it possible to call a remote php script from within Access? I'm thinking something like: DoCMD... http://www.domain.com/scripts/dataquery.php DoCmd.OpenQuery "update_data", acNormal, acEdit...
5
by: cwm137 | last post by:
I am trying to call the click event of a button located in a subform called "Order Subform" from a button in the parent. However, since the subform was made with the wizard, it contains a space in...
16
by: aarklon | last post by:
Hi folks, recently i read the book named assembly language step by step by Jeff Duntemann. in the chapter coding for linux, he has got a paragraph named C calling conventions, which he...
3
by: R Millman | last post by:
under ASP.NET, single stepping in debug mode appears not to stop within event procedures. i.e. 1) Create web page with submit button and event procedure for the click event in the code behind...
4
by: Jack | last post by:
Hi, I am trying to run an example code from a book. However I am getting the following error message: Number: -2147217900 Description: Syntax error or access violation Source: Microsoft OLE...
16
by: Neil | last post by:
I am using Access 2003, and have an ongoing problem of every once in a while losing an event procedure for a form or control. The procedure's still in the code module, but the form or control's...
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:
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
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...
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,...
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...

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.