Solved

break when a value changes

Posted on 2015-02-09
5
110 Views
Last Modified: 2015-02-09
vb.net
vs2012

I want to tell the debugger to stop when a value of "sometextbox.text"  changes
how do I do it?
0
Comment
Question by:MBHEY131
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 40598888
it is not as easy as it was in VB6 for example.

Create a property (get and set), in the TextChanged event of your textbox, set the new property. Finally, place a breakpoint in the setter property.
0
 

Author Comment

by:MBHEY131
ID: 40598917
I have no Idea how to even start to accomplish that?
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 40598956
create a form with a textbox named sometextbox and paste this code:

Public Class Form1

    Private Sub sometextbox_TextChanged(sender As Object, e As EventArgs) Handles sometextbox.TextChanged
        MyProperty = sometextbox.Text
    End Sub

    Private mstrMyProperty As String
    Private Property MyProperty() As String
        Get
            Return mstrMyProperty
        End Get
        Set(value As String)
            mstrMyProperty = value
            If Debugger.IsAttached Then Debugger.Break()
        End Set
    End Property
End Class

Open in new window


As soon as you will type in your textbox, the execution will break.
0
 
LVL 40
ID: 40599139
In some cases, you can simply set a condition to breakpoints located in strategic location. You won't get the exact place where the changes takes place (that is probably the only thing I miss from VB6), but if your breakpoints are located correctly, you might find what causes a specific problem.

To add a condition, simply right click on the red circle that identifies the breakpoint in the margin. You will find a few interesting ways to set the breakpoint, including one where you can set a condition for the break.
0
 

Author Closing Comment

by:MBHEY131
ID: 40599155
Thank You
That helped a lot took me right to the issue I could not find
not sure I've grasped the Get and Set properties yet but I'm learning
Call Stack does not work quite the same
I just got back into development from FoxPro 2.6 with just a little of VB6
Thanx again
Seems this is quite a step backword
2.6 and before the BREAK ON CHANGE was incorporated in the software and pretty easy to implement
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, As I have seen there a lot of requests regarding monitoring and reporting for exchange 2007 / 2010 / 2013 I have decided to post some thoughts together and link to articles that have helped me. Of course a lot of information you can get…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question