CraigGraham Posted March 16, 2004 Report Share Posted March 16, 2004 The rectangular Boolean controls have properties to retrieve the width and height of the button inside the bounding box. However there seem to be no properties to determine the absolute position of the button regardless of the position of labels, captions and decals which can extend the bounding box and change the origin of the control, hence its apparent position in the window. Does anyone know of a way around this aside from either; 1) Creating the labels and pictures as seperate entities, hassle but easy, 2) Assuming the button's bottom right corner will always be aligned with the bottom right of the bounding box- slightly dangerous if a variable length caption is used, but a caption so long it overhangs the control looks a bit cacky anyway and I'd tend to avoid that. Quote Link to comment
Khalid Posted June 13, 2004 Report Share Posted June 13, 2004 Hi Craig, Maybe this does what you're looking for.. We can get the absolute position of the button text. From this, we can find the absolute position of the button (irrespective of the label and caption positions): Get the size of the text and the size of the button itself. Subtracting the text-size from the button-size, and then dividing by two will give us the offset from the absolute position of the text. Subtracting this offset from the absolute position of the text will give us the absolute position (top, left) of the button -- regardless of where the label and captions are (see attached 7.1 VI). Caveat: this assumes (rightfully?) that the button text is smaller than the button size.. However, the above can be modified to take care of this case as well using an absolute value (no pun intended) for the offset. Hope this is what you were looking for. Regards, Khalid Download File:post-19-1087102723.vi Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.