[AccessD] Adjust Label width based on caption

David McAfee davidmcafee at gmail.com
Mon Jan 23 15:15:14 CST 2012


I ended up doing this:


Me.lblHistory.Width = ((Len(trim(Me.lblHistory.Caption)) * 107) + 25)
Me.lblAlert.Left = (Me.lblHistory.Width + 125)

Works good!

David

On Mon, Jan 23, 2012 at 12:20 PM, David McAfee <davidmcafee at gmail.com>wrote:

> I have two labels.
>
> One (lblHistory) has text which can vary in length.
>
> I have another label (lblAlert), to the right on lblHistory which, under
> certain conditions, may be set to be visible, Red or Black and bold or non
> bold.
>
> I'd have lblAlert butted up next to lblHistory, but if the length of the
> text is short, it doesn't look right.
>
> I can figure out how to position the 2nd label, but at the moment I can't
> decide how to "trim" the label length.
>
> Any ideas?
>
> David
>


More information about the AccessD mailing list