|
-
Oct 17th, 2002, 09:09 AM
#1
Thread Starter
PowerPoster
Where are the event stubs?
Is there a way to get a list of all the events for a control, such as keypress or keydown, such as in the visual basic ide dropdown. Do I have to manually add handlers for such events that I want to sink?
-
Oct 17th, 2002, 10:11 AM
#2
I'm pretty sure C# and VB.NET are the same on this one. They hide it in the two combo's at the top of the Code view page. you have to select the control or object in the list on the left and then it'll show the available events in the one on the right.
-
Oct 17th, 2002, 10:11 AM
#3
Frenzied Member
On the property page there should be a little yellow lightening bolt. Click on it and you will see all the events that are associated with the control you are currently working on. Double click the one you want and VS will wire it up for you.
Dont gain the world and lose your soul
-
Oct 17th, 2002, 04:30 PM
#4
Thread Starter
PowerPoster
Cool...I'll give it a try when I get home from work.
Thanks All
-
Oct 17th, 2002, 10:28 PM
#5
PowerPoster
It took me awhile before I got this one myself. Like DevGrip said, click the lightning bolt above the properties for the control. Notice how you can use the drop down button to assign the event to an already existing method. I thought that was cool. Or you can just double click it, and it will create a new one for you.
What I would recommend though, is to name your controls before double clicking on and creating event methods. Otherwise you will have events that are like text1_click, even though you change the name later. This is due to the delegates pointing to that method, and the IDE won't change the methods name if you change the controls name later.
-
Oct 17th, 2002, 10:38 PM
#6
Thread Starter
PowerPoster
Hey Hellswrath,
I've also noticed that when I type the following for example,
e.KeyChar = , I do not get an intellisense list of enum constants as in vb.net or vb6. Is there another way of gettings this support?
-
Oct 18th, 2002, 12:04 AM
#7
That's cool. Isn't it wierd that there are little IDE differences between VB and C# even though they use the same IDE (sorta). I wish they would have made all these things standard. Like the Class, Method, Property Wizard bit too and the xml documentation. It seem that MS really did favor C#.
-
Oct 18th, 2002, 06:52 AM
#8
Thread Starter
PowerPoster
Yeah, there definetly seems to be a bias.
-
Oct 18th, 2002, 11:42 AM
#9
PowerPoster
Originally posted by Lethal
Hey Hellswrath,
I've also noticed that when I type the following for example,
e.KeyChar = , I do not get an intellisense list of enum constants as in vb.net or vb6. Is there another way of gettings this support?
I never really knew there should be an intellisense after the = sign. So, no, I don't know how to get it. If I am miss-understanding you, please tell me.
Just a shot in the dark, if your typing a variable and you don't know the spelling or whatever, but you know the first couple letters, you can type what you know, then hit Ctrl + Space and it will either complete your variable, or give you a intellisense list of variables/methods that match what you have typed so far. This also is useful when your used to VB and case doesn't matter with variables. I just start typing the name, and when I get towards the end I just hit Ctrl + Space and it will capitalize and correctly put the variable name in.
-
Oct 18th, 2002, 03:06 PM
#10
Thread Starter
PowerPoster
Yeah, I know about the ctrl + space auto-complete. Try going into VB.NET and trapping for a keycode in the keydown event of a textbox, you'll see what I mean. Not a big deal, the lack of intellisense will ultimately make us a better programmer.
-
Oct 18th, 2002, 05:00 PM
#11
PowerPoster
I understand now.
Since you already have the System.Windows.Forms namespace specified in a windows forms project, all you have to do is type the word Key. and you will get the same thing:
e.KeyChar = Key.
It would have been nice if they would have done this for the C# editor also, but then again, it probably missleads people as to believe those are thier only choices, which we know isn't true.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|