Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleUse the DebuggerStepThrough attribute in VB .NET
DescriptionThis example shows how to use the DebuggerStepThrough attribute in VB .NET.
KeywordsDebuggerStepThrough, attribute, VB.NET, property
CategoriesVB.NET
 
The DebuggerStepThrough attribute tells the Visual Basic debugger to step through the entrie method when the user steps by pressing F8 or Shift-F8. However, the debugger will stop at breakpoints that you set in the code.

In this example, the debugger will stop at breakpoints in subroutine NoStepthrough but will not let you step through it one line at a time. Subroutine CanStepthrough lets you step through the code normally.

 
Private Sub btnGo_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles btnGo.Click
    NoStepthrough()
    CanStepthrough()
End Sub

<DebuggerStepThrough()> _
Private Sub NoStepthrough()
    ' Try setting a breakpoint in this routine 
    ' and then stepping from there.
    Dim i As Integer
    i = 1
    i = 2
    i = 3
End Sub
Private Sub CanStepthrough()
    ' Try setting a breakpoint in this routine 
    ' and then stepping from there.
    Dim i As Integer
    i = 1
    i = 2
    i = 3
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated