O
Onno Willems
Hi,
Is there any way to resize a label (from code) so it's just wide enough to
fit the string i've just put in it?
I have a label with a not-transparent background, which is on top of a
rectangle.Something like this:
--- MyLabel -------------
The text in the label is dynamic (depends on the record) and set from VBA
code. It can vary in length. I need a way to set the width of "MyLabel" so
it's just wide enough to fit its contents. Stupid as it may be, I can not
find a way to do this? (in VB there seem to be a AutoSize field for labels,
but not in VBA for Access? I even found an MSDN article about setting
AutoSize properties for labels in VBA code in Excel, but in Access this
property seems missing.)
Is there any other way to determine how wide a string would be if printed in
a certain font on a form, and then adjust the width of the label to that
width (without switching to design mode)?
Thanks,
Onno
The Netherlands
Is there any way to resize a label (from code) so it's just wide enough to
fit the string i've just put in it?
I have a label with a not-transparent background, which is on top of a
rectangle.Something like this:
--- MyLabel -------------
The text in the label is dynamic (depends on the record) and set from VBA
code. It can vary in length. I need a way to set the width of "MyLabel" so
it's just wide enough to fit its contents. Stupid as it may be, I can not
find a way to do this? (in VB there seem to be a AutoSize field for labels,
but not in VBA for Access? I even found an MSDN article about setting
AutoSize properties for labels in VBA code in Excel, but in Access this
property seems missing.)
Is there any other way to determine how wide a string would be if printed in
a certain font on a form, and then adjust the width of the label to that
width (without switching to design mode)?
Thanks,
Onno
The Netherlands