You should create a small project with the non-working code and upload it.
I can't reproduce this is in the most simple demo project, but I think agraham is pointing in the right direction:
This produces the right Boolean value (False):
If (10dip + iWidestButtonWidth * iButtonsToAdd + (iButtonsToAdd - 1) * 5dip) > Parent.Width Then
bNonUniformButtonWidths = True
End If
Whereas this gives the wrong Boolean value (True):
If 10dip + iWidestButtonWidth * iButtonsToAdd + (iButtonsToAdd - 1) * 5dip > Parent.Width Then
bNonUniformButtonWidths = True
End If
The only difference between the above 2 code blocks is the added brackets.
No idea why I can't reproduce this, maybe because the real app takes up more memory or maybe because
the above 2 codeblocks in the real app run in a ResumableSub and the demo app had no ResumableSub (will try that).
RBS