Author Topic: Understand when listbox autosize occurs  (Read 1488 times)

0 Members and 1 Guest are viewing this topic.

AKS

  • Guest
Understand when listbox autosize occurs
« on: February 12, 2012, 11:40:52 PM »
I am seeking to understand when a listbox.width correctly reflects the autosized width so that I can be sure the value is correct when needed. My application is a modeless form that has a listbox containing the open dwg filenames with some control items to the listbox right. Event handlers update the listbox content as dwg files open and close. The listbox and the form are set to autosize. The control items are set to remain relative to the form top but not to the left or right. A function within the form repositions the control items relative to the listbox width, which Windows changes on its own based on the file name length. The right most set of controls visibility can change from visible to not visible.  That visibility in combination with the form being autosizing results in a desired expanding options edge to the form. The problem is that the listbox seems to not always re-size or re-sizes at some point after the function to reposition the controls reads the listbox.width value. It does seem that the listbox always is correctly sized and has its .width the correct value after the entire form has autosized on its own as a result of the controls visibility change. I have tried every clueless thing I can think of to no avail.  Thanks.

AKS

  • Guest
Re: Understand when listbox autosize occurs
« Reply #1 on: February 14, 2012, 01:06:14 PM »
Sorry, It is .Refresh() that I needed.