If MyWidth is a #DEFINE constant your approach won't work because the #DEFINE is a compiler directive that is only evaluated at compile time. You would be better to use the SYSMETRIC() call right in your code or to use a property or memvar to hold the value.