I am trying to set a data breakpoint using C#, Windows 10, in a Winforms project. The version of VS is 2019.
The problem I am having is that the option is grayed out under debug->set new breakpoint.

This is my first time trying to use data breakpoints, and I can’t figure out why it isn’t working.
I need to break when the location of a control changes because I can’t seem to find out where in the program the location is being altered.
This feature is only supported for C++.

Your best bet is to handle the LocationChanged event and hope the call stack is relevant. This is a fairly odd thing to be concerned with, usually you are the one who changes the location!

EDIT
Hmm, it seems maybe .NET has or is getting them? I’ve never tried to use one. Seems like there were still scenarios where they don’t work at the time of that post.

Breakpoints work in C# too, but setting a breakpoint at an arbitrary position based on an action sounds strange.

source