Is there a way with the VB interface to either:
GetTextMetrics (ie: take Label, and I want to get the Width of the text that would be outputted by that control.)
Determine if the Text is "larger" than the control.
Basically, I have a form, with multiple "display" labels, that are affected by different colors for the parameters of my application's color coding. HOwever, the text that is displayed in those labes varies based upon the values of a combo box. I populate the combo-box real time, and then when I select Each one in the box, it changes the Text of the Label, and updates the foreground and background colors based upon that current entries settings.
HOwever, sometimes, the text is larger than my initial label size (82x20). Now I can set the AutoSize property, but that does something I don't like: It doesn't obey Form Anchors.
I have 5 labels, each one could change. All the form Anchors are set, so when i resize one label, I can expand the form based upon the width change, and all the other controls follow suit. however, if the other 4 labels are AutoSize=True, they won't resize unless they need to.
WHat I want:
I want an event, (or a precheck function) that tells me the width of a Label when I've Set it's Text propery (or before I set it), which allows me to resize the form to expand the Label dimensions appropriate to fit the text.
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner