473,378 Members | 1,110 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.

Very Basic C# From Question

Hi everyone. I am moving from VB.Net to C#. C# is pretty easy but i do have
one thing i don't like that im probably doing it the hard way and want to
see if there is an easy way to do it. When you want to code an event for a
control on a form in VB.Net you just select the control from the left
comobox on top of the code window. You then select the event from the right
combobox. Apparently C# doesn't have this. Say you want to code off the
LostFocus event on button 1. The way i currently do it is to write the
following code manually:

this.button1.LostFocus += System.EventHandl..........

This is kind of a pain. You have to manually code the event handler function
and you also have to look at exactly what type of eventargs to pass in the
function? Is there an easier way to do this or is this the only way?

thanks

Brrent
Nov 17 '05 #1
3 1161
The Properties window of C# controls have an Events button that VB does not
have.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Brent" <br*****@spam.hotmail.com> escribió en el mensaje
news:ez**************@TK2MSFTNGP14.phx.gbl...
Hi everyone. I am moving from VB.Net to C#. C# is pretty easy but i do
have one thing i don't like that im probably doing it the hard way and
want to see if there is an easy way to do it. When you want to code an
event for a control on a form in VB.Net you just select the control from
the left comobox on top of the code window. You then select the event from
the right combobox. Apparently C# doesn't have this. Say you want to code
off the LostFocus event on button 1. The way i currently do it is to write
the following code manually:

this.button1.LostFocus += System.EventHandl..........

This is kind of a pain. You have to manually code the event handler
function and you also have to look at exactly what type of eventargs to
pass in the function? Is there an easier way to do this or is this the
only way?

thanks

Brrent

Nov 17 '05 #2
Well, the other way to do it is to select the control or form that you want
to add an event handler for and click the events button on the properties
window, then double click the event handler you want to add. Simple right?

HTH
Steve

"Brent" <br*****@spam.hotmail.com> wrote in message
news:ez**************@TK2MSFTNGP14.phx.gbl...
Hi everyone. I am moving from VB.Net to C#. C# is pretty easy but i do have one thing i don't like that im probably doing it the hard way and want to
see if there is an easy way to do it. When you want to code an event for a
control on a form in VB.Net you just select the control from the left
comobox on top of the code window. You then select the event from the right combobox. Apparently C# doesn't have this. Say you want to code off the
LostFocus event on button 1. The way i currently do it is to write the
following code manually:

this.button1.LostFocus += System.EventHandl..........

This is kind of a pain. You have to manually code the event handler function and you also have to look at exactly what type of eventargs to pass in the
function? Is there an easier way to do this or is this the only way?

thanks

Brrent

Nov 17 '05 #3
Yep sorry i didn't know it was there :). Thanks for the help. I appreciate
it.
"Steve Long" <St**********@NoSpam.com> wrote in message
news:ew**************@tk2msftngp13.phx.gbl...
Well, the other way to do it is to select the control or form that you
want
to add an event handler for and click the events button on the properties
window, then double click the event handler you want to add. Simple right?

HTH
Steve

"Brent" <br*****@spam.hotmail.com> wrote in message
news:ez**************@TK2MSFTNGP14.phx.gbl...
Hi everyone. I am moving from VB.Net to C#. C# is pretty easy but i do

have
one thing i don't like that im probably doing it the hard way and want to
see if there is an easy way to do it. When you want to code an event for
a
control on a form in VB.Net you just select the control from the left
comobox on top of the code window. You then select the event from the

right
combobox. Apparently C# doesn't have this. Say you want to code off the
LostFocus event on button 1. The way i currently do it is to write the
following code manually:

this.button1.LostFocus += System.EventHandl..........

This is kind of a pain. You have to manually code the event handler

function
and you also have to look at exactly what type of eventargs to pass in
the
function? Is there an easier way to do this or is this the only way?

thanks

Brrent


Nov 17 '05 #4

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

Similar topics

9
by: Tom | last post by:
Hey all, I've been planning to get myself started with DocBook for quite some time now, so when I unexpectedly encountered a task for which DocBook might actually be very useful, I thought I'd...
30
by: Vla | last post by:
why did the designers of c++ think it would be more useful than it turned out to be?
5
by: Lee David | last post by:
I went to the sun site and downloaded what I hope is the development part of java. I downloaded JDK5 with Netbeans. I installed it and now have a folder in my program group "Netbeans". Is that...
10
by: Jason Curl | last post by:
Greetings, I have an array of 32 values. This makes it extremely fast to access elements in this array based on an index provided by a separate enum. This array is defined of type "unsigned long...
6
by: msnews.microsoft.com | last post by:
Hello All, I am very new to ASP.NET and I have a basic question. Can somebody please explain? I have an .aspx Web Page with a textbox control. When the Page initially loads I am calling a...
8
by: pamelafluente | last post by:
Hi, I would like to get some advice. I know enough vb.net on win apps, but I have never worked on web applications and asp.net. I would appreciate if you could indicate the most basic...
6
by: aghazalp | last post by:
hi guys, this would be the most basic question ever...I am not a programmer but I am trying to learn programming in python...I was reading John Zelle's text book and instructed me to make .py file...
17
by: blueapricot416 | last post by:
This is a very basic question -- but I can't find the answer after looking for 20 minutes. If you code something like: function set_It() { setTimeout('Request_Complete("apple", -72)',5000) }...
7
by: Bruno43 | last post by:
Hi I am trying to learn Visual Basic and I am getting everything for the most part, mainly because of my ability to read code like a book, but my question is what is the best way to Navigate through...
56
by: mdh | last post by:
As I begin to write more little programs without the help of the exercises, little things pop up that I need to understand more fully. Thus, below, and although this is not the exact code, the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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?
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
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.