locating related End If for an IF statement?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In C# you have

If ...
{
{
...
}
}

If you place the mouse cursor next to a bracket and press ctrl something
(can't remember) - the corresponding bracket gets highlighted. Does VB2005
have something like that for If statements?

Thanks,
Rich
 
Rich,

Do you really need that, in VB.Net I can go deeper than 20 if I am using C#
I am quick in trouble as I am 7 deep.

Cor
 
I don't know of any key on the C# side of VS that does that. All I eve did
was click just to the left of an open brace or just to the right of a close
brace and it automatically highlighted both the open and close braces.

As far as I've found, VS for VB.NET doesn't have anything similar, keypress
or not.
 
In C# you have

If ...
{
{
...
}

}

If you place the mouse cursor next to a bracket and press ctrl something
(can't remember) - the corresponding bracket gets highlighted. Does VB2005
have something like that for If statements?

Thanks,
Rich

I believe this is just an IDE macro, so perhaps you could locate the
macro's code in the C# editor and then translate it into the VB
editor.

Thanks,

Seth Rowe
 
Thank you all for your replies. As for why I would want to do this:

if ...
....
if...
....
if...
....
end if
...
endif
...
end if


If I have a bunch of nested if statements with code in between each If, it
becomes difficult/tedius to locate the corresponding End IF.
 
But wouldn't it be better, rather than having several nested if's, to have a
CASE statement? This would alleviate the need to remember how deep you go in
an if statement or the need for remembering which endif goes with it.

Bruce
 
Back
Top