N
Nick Burns
Working with Excel 97.
I have some code that will resize a form and a listbox
based on the number of columns the listbox will have.
We'll call this Form1.
When I first load Form1, the listbox's width is set
correctly. However, it seems that other forms that I view
affect the listbox- we'll call this Form2. I'll load and
unload Form2 and then reload Form1, but now the listbox
will not change it's width properly. The form changes
without problem.
I put in a test button to show me what the listbox's width
is set to, and it tells me that the listbox is correctly
set to it's proper width. I then select any item in the
listbox and click the test button and now it tells me
the "actual" width of the listbox.
So, in the code for the test button I put in some code to
set the width of the listbox, and again it tells me that
it has properly set the width, but when I select an item,
I'm now told what the "actual" width is.
I then added code to the test button to set the focus to
the listbox and to select an item, but it still doesn't
want to resize.
It seems something from Form2 is affecting Form1 in some
matter. Not all forms do this and I can't tell what's
different from the forms that do affect the listbox as
opposed to those that do? Form2 does have a combobox on
it, whereas the other forms do not. (I removed the
comboboxes, but it didn't make any difference)
Any one have a clue to why this is?
I have some code that will resize a form and a listbox
based on the number of columns the listbox will have.
We'll call this Form1.
When I first load Form1, the listbox's width is set
correctly. However, it seems that other forms that I view
affect the listbox- we'll call this Form2. I'll load and
unload Form2 and then reload Form1, but now the listbox
will not change it's width properly. The form changes
without problem.
I put in a test button to show me what the listbox's width
is set to, and it tells me that the listbox is correctly
set to it's proper width. I then select any item in the
listbox and click the test button and now it tells me
the "actual" width of the listbox.
So, in the code for the test button I put in some code to
set the width of the listbox, and again it tells me that
it has properly set the width, but when I select an item,
I'm now told what the "actual" width is.
I then added code to the test button to set the focus to
the listbox and to select an item, but it still doesn't
want to resize.
It seems something from Form2 is affecting Form1 in some
matter. Not all forms do this and I can't tell what's
different from the forms that do affect the listbox as
opposed to those that do? Form2 does have a combobox on
it, whereas the other forms do not. (I removed the
comboboxes, but it didn't make any difference)
Any one have a clue to why this is?