Emilie

Emilie

  • NA
  • 14
  • 0

Position of custom controls messed up by scrollbar?

Aug 8 2008 1:47 AM
Hi there,

I have a custom control that contains a button which adds the same custom control bellow it when you click on it. So you can keep adding and adding the same control vertically. My problem happens when the controls get close to the bottom of the window and the scrollbar appears. Then the controls appear more and more seperated from each other (no more 90 offset for the Y). Here is my code:

            FunctionRule newRule = new FunctionRule();
            newRule.functionIdentifier = e.Identifier;
            Point newRulept = newRule.Location;
            int positionYRule = lastRuleLocationPoint.Y + 90;
            int positionXRule = lastRuleLocationPoint.X;
            newRulept.Offset(positionXRule, positionYRule);
            MessageBox.Show(lastRuleLocationPoint.ToString());

The MessageBox always shows the right number that increments by 90, but on the screen it looks WEIRDDDDD...

Anyone got any idea?

Thanks,
Emmi

Answers (1)