473,473 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1815
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
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.