473,883 Members | 1,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I press a command button in code?

In VB6 all you needed to do was set the name of the command button to True
like:

cmdGo = True

but this does not work in vb.net

Is there a code sample that shows how to do this?
Nov 21 '05
13 9896
>Personally, I consider it bad style to pass 'Nothing' in the standard event
handler's parameters because it breaks the event handling pattern.

Which you are breaking even harder because if the event is not a "click
event" you suggest not to pass nothing. You pretend that you send forever
events and you are only doing that partially. Because that you are than not
consequent is there in my opinion a much harder change on wrong code.

Just my thought,

Cor
Nov 21 '05 #11
"Cor Ligthert [MVP]" <no************ @planet.nl> schrieb:
Personally, I consider it bad style to pass 'Nothing' in the standard
event handler's parameters because it breaks the event handling pattern.

Which you are breaking even harder because if the event is not a "click
event" you suggest not to pass nothing.


That's not true. I simply do not suggest to pass 'EventArgs.Empt y' in the
event's second parameter, because sometimes a more specific type is
required.

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

Nov 21 '05 #12
Herfried,
That's not true. I simply do not suggest to pass 'EventArgs.Empt y' in the
event's second parameter, because sometimes a more specific type is
required.

This passing of EventArgs.Empty is in my opinion more worse, it suggest that
there is an argument and than it is empty. With 'sender Is nothing' I am
sure that because I use forever the same passing signature in this
situations that there is as well no event.

Although I have showed you that I have used passing of 'me'. This threads
shows me that I should avoid that in future.

Just my thought,

Cor
Nov 21 '05 #13
"Cor Ligthert [MVP]" <no************ @planet.nl> schrieb:
That's not true. I simply do not suggest to pass 'EventArgs.Empt y' in
the event's second parameter, because sometimes a more specific type is
required.

This passing of EventArgs.Empty is in my opinion more worse, it suggest
that there is an argument and than it is empty.


For the 'Click' event, the 'e' parameter contains a reference to
'EventArgs.Empt y' by default. So passing 'EventArgs.Empt y' is OK. For
other event handlers it's better to pass a more appropraite event arguments
object, as I already stated.

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

Nov 21 '05 #14

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

Similar topics

16
2565
by: MLH | last post by:
In Access 97 and Access 2.0 applications, if a command button has the focus, the spacebar will 'PRESS" the key. How does one go about disabling this annoying BEATURE?
6
2253
by: Blue Bell Trading - Customer Services | last post by:
Hi, I have a text box, when a user presses enter I wish for the event on a command button on the form to be performed -- Kind Regards, Customer Services Blue Bell Trading
22
3209
by: Ricky W. Hunt | last post by:
First, the subject probably doesn't use the correct terms but I'm not sure what it's called in VB. I'm writing a media player app. The subroutine that handles the "open file" button contains an If statement to see if a file was already playing and if so executes some code to stop the previous file from playing among other things. There's also a "stop" button on the form that contains the exact same code. Obviously it would be easier if...
0
1978
by: neeraj | last post by:
Hi Everybody I have one problem in my asp.net web application. The problem is that I check the date validation in code behind; if user not gives the valid data and press save button then I fire my own exception by JavaScript alert message Through register startup script Like RegisterStartupScript("Startup", "<script language=javascript>
3
2185
by: gilbert3b2g | last post by:
I'm new to Python, and programming in general. What I'm trying to do here is to load a list of accounts from a file on my harddrive into a string of Buttons in Tkinter, and when I press one of the Buttons, which has one of my account name, it will load that account into a new window. But I don't understand how to code the proccess that would tell the program what account is selected. Any help with this would be very appreciated. Thanks in...
3
3415
by: fieldling | last post by:
I've got a command button on a form that I would also like to work if I press, for example, F5. (Sounds pointless having a command button I know but there you go). I've tried using the On Key Press event and autokeys but can't seem to get it to work. Any ideas?
6
7431
by: Dan2kx | last post by:
Hello again... just a quicky (hopefully) How do you set a command button's "special effect" to be sunk... using VB code. i have 3 buttons that i want to "sink" the active button for the one that is active... like a toggle switch! thanks Dan
1
7043
by: daonho | last post by:
I tried to use javascript to trigger up the button click function when user press enter key from the textbox. This function work fine with a single button click such has login page. However, if the page has multiple button such login page with a search function somewhere around, then it's not respond properly. I have attached a brief example of two text boxes and two button. When ever a key is press on textbox one, I want to trigger...
3
1237
by: Oriane | last post by:
Hi there, I would like to use a asp:Button to command a blind: when I press the Up button, the blind is opening, when I release the button, the blind stops. So I would like to send two commands to the Web server, one when I start pressing the button, the other when I release it. Any idea ?
0
9777
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10728
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10405
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9558
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7114
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5782
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4602
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3227
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.