473,386 Members | 1,908 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,386 software developers and data experts.

Selecting an event

Ant
Hi,
I'm new to .NET, though program with VB. I'm used to selecting an event from
the right side drop down box of the VB IDE. That seems to have changed with
..NET. How do you choose an event, say for example, the click event of a form
object so as to write a method for that event.

Thanks for your help on this
Regards
Ant
Jul 21 '05 #1
9 1809
1 - Just double click on The object. For example, Draw the button and then
double click on it. That would take u to the button_click event.

2- the click event would be by default, if you want a double click event
then , draw button first, then when ur in code view. Choose button in class
name on top, and then choose the event u want.


"Ant" wrote:
Hi,
I'm new to .NET, though program with VB. I'm used to selecting an event from
the right side drop down box of the VB IDE. That seems to have changed with
.NET. How do you choose an event, say for example, the click event of a form
object so as to write a method for that event.

Thanks for your help on this
Regards
Ant

Jul 21 '05 #2
Ant
Hi mario,
Thanks for that, however It's still no clearer. I understand how i can get
to the default event, that is, by clicking on the control, but how do i get
to all the other events such as, i don't know, say, LostFocus or MouseDown,
or KeyUp. Once I'm in the 'code' page, where from there. There are two drop
down boxes. The top left appears only to display className.formName, the one
on the top right displays each control on the form & the default event
(usually a click event, the event which it automatically opens to when you
click it). How do I get to all the other events.

Thanks very much for your help
Ant

"Mario" wrote:
1 - Just double click on The object. For example, Draw the button and then
double click on it. That would take u to the button_click event.

2- the click event would be by default, if you want a double click event
then , draw button first, then when ur in code view. Choose button in class
name on top, and then choose the event u want.


"Ant" wrote:
Hi,
I'm new to .NET, though program with VB. I'm used to selecting an event from
the right side drop down box of the VB IDE. That seems to have changed with
.NET. How do you choose an event, say for example, the click event of a form
object so as to write a method for that event.

Thanks for your help on this
Regards
Ant

Jul 21 '05 #3
exactly what you said. Choose the object name in the first drop down box
which would be button1 for example. then choose the event u want for it in
the second drop down box which would be mousedown or doubleclick.
"Ant" wrote:
Hi mario,
Thanks for that, however It's still no clearer. I understand how i can get
to the default event, that is, by clicking on the control, but how do i get
to all the other events such as, i don't know, say, LostFocus or MouseDown,
or KeyUp. Once I'm in the 'code' page, where from there. There are two drop
down boxes. The top left appears only to display className.formName, the one
on the top right displays each control on the form & the default event
(usually a click event, the event which it automatically opens to when you
click it). How do I get to all the other events.

Thanks very much for your help
Ant

"Mario" wrote:
1 - Just double click on The object. For example, Draw the button and then
double click on it. That would take u to the button_click event.

2- the click event would be by default, if you want a double click event
then , draw button first, then when ur in code view. Choose button in class
name on top, and then choose the event u want.


"Ant" wrote:
Hi,
I'm new to .NET, though program with VB. I'm used to selecting an event from
the right side drop down box of the VB IDE. That seems to have changed with
.NET. How do you choose an event, say for example, the click event of a form
object so as to write a method for that event.

Thanks for your help on this
Regards
Ant

Jul 21 '05 #4
you choose the events from the declarations drop down box.
Jul 21 '05 #5
Ant
Hi Mario,
Thanks again for your response. I still can't seem to find the events. I'm
using C# if that might make any difference to VB perhaps? The top left drop
down box only offers a single choice, that of Form1. The top right box still
only offers click events for the buttons on the form. What am I missing?
Thanks for your patience
Ant

"Mario" wrote:
you choose the events from the declarations drop down box.

Jul 21 '05 #6
Hi Ant,

C# is completely different to VB.Net regarding event handling :)

In VB.Net go to code view. There should be 2 comboboxes above the code. The left one selects the object, and the right one selects the event etc.

In C# you do this in the design view. Select the object either by clicking on it in the design or selecting it from the ComboBox above the properties dialog box. Then click on the lightning icon just below this ComboBox and the properties dialog will switch to show events. DoubleClick the event to create a default name for the event, write the name of the event in the field left of the event name or select from a list of already created events with the same kind of EventHandler (handy if you have a bunch of different controls and want to have a single Click event for all of them).
On Sat, 25 Jun 2005 11:13:01 +0200, Ant <An*@discussions.microsoft.com> wrote:
Hi Mario,
Thanks again for your response. I still can't seem to find the events. I'm
using C# if that might make any difference to VB perhaps? The top left drop
down box only offers a single choice, that of Form1. The top right box still
only offers click events for the buttons on the form. What am I missing?
Thanks for your patience
Ant

"Mario" wrote:
you choose the events from the declarations drop down box.


--
Happy coding!
Morten Wennevik [C# MVP]
Jul 21 '05 #7
Ant
That's great. thank you. I should have made myself more clear re C# earlier.
Thanks Mario as well

Ant

"Morten Wennevik" wrote:
Hi Ant,

C# is completely different to VB.Net regarding event handling :)

In VB.Net go to code view. There should be 2 comboboxes above the code. The left one selects the object, and the right one selects the event etc.

In C# you do this in the design view. Select the object either by clicking on it in the design or selecting it from the ComboBox above the properties dialog box. Then click on the lightning icon just below this ComboBox and the properties dialog will switch to show events. DoubleClick the event to create a default name for the event, write the name of the event in the field left of the event name or select from a list of already created events with the same kind of EventHandler (handy if you have a bunch of different controls and want to have a single Click event for all of them).
On Sat, 25 Jun 2005 11:13:01 +0200, Ant <An*@discussions.microsoft.com> wrote:
Hi Mario,
Thanks again for your response. I still can't seem to find the events. I'm
using C# if that might make any difference to VB perhaps? The top left drop
down box only offers a single choice, that of Form1. The top right box still
only offers click events for the buttons on the form. What am I missing?
Thanks for your patience
Ant

"Mario" wrote:
you choose the events from the declarations drop down box.


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

Jul 21 '05 #8
That's ok. Usually coding in C# is VB.Net is identical save the syntactical differences, but event handling is one of the exceptions. You are not the first one to ask about it :)

--
Happy coding!
Morten Wennevik [C# MVP]
Jul 21 '05 #9
Morton,

Sadly enough will it be in the VB 2005 version the same as in C#.

I have nothing against C# however I find the VBNet method much easier and
quicker.

Cor
Jul 21 '05 #10

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

Similar topics

3
by: Paweł | last post by:
I'm desinging a graphical interface and I frequently take advantage of the double click event. Unfortunately in most browsers double clicking also involves selecting and I would like to avoid that...
6
by: aaa | last post by:
Hi I am trying to create a read-only DataGrid that would always have current row selected. Currently, I am using method: public void SelectDataGridRow(DataGrid dg) { if (dg.CurrentRowIndex >...
2
by: David Anderson | last post by:
I'm working on a Windows app that has a ListView containing a bunch of items. When the user clicks on an item, the app displays the item'd details. The user then has the opportunity to edit these...
0
by: Steven W | last post by:
I'm trying to setup a datagrid in a custom control where I can select the row with the Select column hidden and have it call the "SelectIndexChanged" event. In the "SelectIndexChanged" I just want...
1
by: Nathan Sokalski | last post by:
When testing a form of mine which uses RequiredFieldValidators that have the Display property set to "Dynamic" the ErrorMessage property is automatically removed when an entry is completely typed...
3
by: larry mckay | last post by:
anyone have the code to select and listview item or row (subitems) after a doubleclick event from a listview. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate...
9
by: Ant | last post by:
Hi, I'm new to .NET, though program with VB. I'm used to selecting an event from the right side drop down box of the VB IDE. That seems to have changed with ..NET. How do you choose an event, say...
2
by: Ryan Adler | last post by:
I have a terrible headache from this problem. Perhaps someone can help. My XML is formatted like this: <events> <event> <starts-at>123456<starts-at/> <event> ... <events/>
2
by: areef.islam | last post by:
Hi, I am kinda new to javascript and I am having this problem with selecting multiple options from a select tag. Hope someone can help me out here. here is my code...
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: 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:
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
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
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
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...

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.