Articles > Development
I tried to set the anchor property of a button in vb.net using code instead of the designer, but I could never get the button to anchor to bottom right like I wanted. The secret is to look at the integer number for each direction then add them together to get multiple directions to work correctly. (see image). Example: bottom + right = 8+2 = 10.
vb.net and dynamic anchors for control objects
Last Updated: 3/3/10I tried to set the anchor property of a button in vb.net using code instead of the designer, but I could never get the button to anchor to bottom right like I wanted. The secret is to look at the integer number for each direction then add them together to get multiple directions to work correctly. (see image). Example: bottom + right = 8+2 = 10.
Keywords: vb.net control button anchor dynamic from code