Hi there,
I added a snapping to a custom tool and trying to change a snap tip with ISnappingEnvironment.SnapTipSymbol Property
like
public override void OnMouseMove(int Button, int Shift, int X, int Y)
{
...
snapResult = m_Snapper.Snap(m_CurrentMouseCoords);
//Update the snapping feedback.
if (snapResult != null)
{
(m_SnappingEnv.SnapTipSymbol as IFormattedTextSymbol).Text = "Changed";
m_SnappingFeedback.Update(snapResult, 0);
}
...
}
public override void Refresh(int hDC)
{
if (m_SnappingFeedback != null)
m_SnappingFeedback.Refresh(hDC);
}
It does not update the actual tip.
In the help ESRI says that
"You have a number of options to customize the tip symbol, including advanced text capabilities provided by IFormattedTextSymbol to provide options for backgrounds, offsets, or right-to-left text capabilities. "
Any help will be appreciated.
Solved! Go to Solution.
Hi Mark,
In the code you posted, the text you are changing is the IFormattedTextSymbol.Text property.
This isn't the string being used by the snapping feedback. As far as I know, this property is just used internally by the ISymbol to apply formatting.
In fact, there's no straightforward way to replace the tip with a custom text. The only way I know is writing an interface which inherits ISnappingFeedback and dealing manually with the Update and Refresh to draw your custom text.
By the way, the string used in the feedback is the one at ISnappingResult.Description.
Good luck on your customization.
Hi Mark,
In the code you posted, the text you are changing is the IFormattedTextSymbol.Text property.
This isn't the string being used by the snapping feedback. As far as I know, this property is just used internally by the ISymbol to apply formatting.
In fact, there's no straightforward way to replace the tip with a custom text. The only way I know is writing an interface which inherits ISnappingFeedback and dealing manually with the Update and Refresh to draw your custom text.
By the way, the string used in the feedback is the one at ISnappingResult.Description.
Good luck on your customization.