I running into an infinite loop problem.
I have two numeric up/down controls (Height and Width input parameters). When the user changes the value of one of the controls, I need to scale the other to keep a height to width ratio constant.
Is there a way to set the value of a control without invoking a ValueChanged Event. I only want the ValueChanged event to execute when the user changes the value.
private void FloorLength_ValueChanged(object sender, EventArgs e)
{
if (this.mCurrentDocument.System.SuperTrakSystem.FloorBitmap != null)
{
FloorWidth.Value = FloorLength.Value *
((decimal)this.mCurrentDocument.System.SuperTrakSystem.FloorBitmap.Height /
(decimal)this.mCurrentDocument.System.SuperTrakSystem.FloorBitmap.Width);
}
}
private void FloorWidth_ValueChanged(object sender, EventArgs e)
{
if (this.mCurrentDocument.System.SuperTrakSystem.FloorBitmap != null)
{
FloorLength.Value = FloorWidth.Value *
((decimal)this.mCurrentDocument.System.SuperTrakSystem.FloorBitmap.Width /
(decimal)this.mCurrentDocument.System.SuperTrakSystem.FloorBitmap.Height);
}
}