PDA

View Full Version : ##solved## Adding event handler in VB 2010



Lorem-Ipsum
05-10-10, 20:30
I'm just getting used to VB 2010 for college.

When I double click an object it usually switches to the code view and adds the handle for that object.

However if I clear the code to start again when I double click on an object it opens the form designer and adds the handle there instead of in the code.

Anyone know how I can fix this? Have I done something stupid?

Terbinator
05-10-10, 20:32
It's just what happens when you use 'form' view IIRC.

Toonshorty
05-10-10, 20:33
Does it not open a new tab called like Form1.vb

The sub/class should be in there so if you just leave it you can switch to the tab rather than double clicking.

Temporary solution for now ;)

Lorem-Ipsum
05-10-10, 20:35
Does it not open a new tab called like Form1.vb

The sub/class should be in there so if you just leave it you can switch to the tab rather than double clicking.

Temporary solution for now ;)

It should open a tab called form1.vb and show the sub.

However it opens a tab called Form1.designer.vm with all the events instead.

How else can I add subs rather than double clicking?

I'm new to vb.

Terbinator
05-10-10, 20:35
Either that or use console view, which in all seriousness is a lot easier to code in - you jsut get screwed over in the second year (Computing?) as you have to use form view and start implementing databases :/

Lorem-Ipsum
05-10-10, 20:38
Fixed it. You have to manually add the class before double clicking works.

I'm more used to python.

I like the look of console view TBH. Its more what I'm used to from coding in Linux.

Terbinator
05-10-10, 21:07
We spent the first year of Computing using console then basically had no choice but to use Form View in the second, was pretty poop TBH - probably contributed to my poor CW having very little programming in it :D

Lorem-Ipsum
05-10-10, 21:13
I'm doing an ICT BSc (first year) and for some reason Visual Basic was the language of choice.