Viewing Code

dpatfield66

Well-known member
Joined
Apr 6, 2006
Messages
136
Programming Experience
5-10
Here's a whacko question.

In my modules, I've got some commenting at the top of the module that lists each function and sub that I have below.

Is there a way to effectively create a "link", so when I select, or double-click, or ctrl-click (whatever) on one of the commented function/sub titles, I can go directly to my code for that function/sub.

Kind of like an HTML tag?

Just wondering. That would really rock if I could do that.
Until then, I just do a Find, or simply scroll down, but that's boring.
 
VB.NET:
#region " Your comment here "

Subroutines
Functions
etc

#end region

Then you can minimize and maximize each region by clicking the +/- on the side
 
I sort of follow this...

I understand that the # sign is a tag, and that you've surrounded a region, but I want my Title:

Ex: Function One

to be at the top of the code module.

And I want to be able to click this comment and be taken to my Function One.

Ex: Public Function One(ByVal objOne as Object, etc....)

code, code, code, etc....

I want my cursor to go to the top of the function.
 
Oh, you mean basically like a contents that you can click to goto.. There's nothing like this that i know of, sorry

Couldnt you just rename your module Function One, and use the solution explorer to navigate?
 
2 solutions:

at the top of the code, there exists 2 combo boxes... ensure the left one is displaying the name of your module...
and the right hand one will list all the subs and functions. choose one from the list to jump to it

it doesnt show everything - i.e. methods that handle events, you have to select the object that genereates the event on the left.

i.e. choose Button1 from the left list, and you get the events list in the combo on the right, with the handled events in bold



or, for complete control of what you can jump to, write a sub like this at the top of your code:

Private Sub _dummy()
Exit Sub
chkFolderForEachClient_CheckedChanged(Nothing, Nothing)
btnPrevWeek_Click(
Nothing, Nothing)
End Sub

the exit sub ensures if it ever gets called, it does nothing. after that, list every sub and function in this module/class and use Nothing for every argument

now right click on one of the function names and choose "goto definition" and your code jumps to the head of the function


Cat.SkinWays > 1 ;)
 
Back
Top