MelancholischMir
New member
- Joined
- Oct 9, 2014
- Messages
- 3
- Programming Experience
- 10+
Greetings fellow coders,
I am using Visual Studio 2010, .NET Framework 4
I have run into a very unique situation involving the dynamic creation of comboboxes and checkboxes and adding them to my custom "simulated" Control-embedding listview. You see, I am adding the custom listview into a panel and the panel serves as the parent object that will enable scrolling up and down the list after more than 19 items have been added. Using the panel for scrolling was an implementation decision that I decided to use because enabling scrollbars of the listview itself causes wonkiness (the positions of the dynamically-created controls are fixed therefore scrolling down does not cause the controls below view to appear).
Anyway, it turns out that, some time after the scrollbar appears in the panel (after more than 19 items have been added), the VERY first combobox (listView.Controls[0]) "disappears."
What I mean by "disappear" is, the properties Top and Left get set to 0 and the Width gets set to 65535 (sometimes gets set to 0; sporadic behavior there; perhaps suggesting carryover flag of Width's datatype but making no assumptions).
The program never seems to be consistent about when it makes the first combobox disappear, aside from the fact that it is always after 19 list items have been added (thus enabling the scrollbar). Debugging through the code, I change the values back to normal and then it reappears...
...but then after adding even more items to the listview, the first combobox disappears again. This only happens to fieldView.Controls[0]. Never any of the checkboxes nor subsequent comboboxes. Just that one.
This is completely mysterious behavior, and I was wondering if someone could help me discover the cause.
Here is my source code (C-Sharp project files):
Form code: C++ code - 29 lines - codepad
Custom tab page code (TabPageIncludes.cs): C++ code - 62 lines - codepad
Custom list view code (ControlListView.cs): C++ code - 131 lines - codepad
Much appreciation to any help.
I am using Visual Studio 2010, .NET Framework 4
I have run into a very unique situation involving the dynamic creation of comboboxes and checkboxes and adding them to my custom "simulated" Control-embedding listview. You see, I am adding the custom listview into a panel and the panel serves as the parent object that will enable scrolling up and down the list after more than 19 items have been added. Using the panel for scrolling was an implementation decision that I decided to use because enabling scrollbars of the listview itself causes wonkiness (the positions of the dynamically-created controls are fixed therefore scrolling down does not cause the controls below view to appear).
Anyway, it turns out that, some time after the scrollbar appears in the panel (after more than 19 items have been added), the VERY first combobox (listView.Controls[0]) "disappears."
What I mean by "disappear" is, the properties Top and Left get set to 0 and the Width gets set to 65535 (sometimes gets set to 0; sporadic behavior there; perhaps suggesting carryover flag of Width's datatype but making no assumptions).
The program never seems to be consistent about when it makes the first combobox disappear, aside from the fact that it is always after 19 list items have been added (thus enabling the scrollbar). Debugging through the code, I change the values back to normal and then it reappears...
...but then after adding even more items to the listview, the first combobox disappears again. This only happens to fieldView.Controls[0]. Never any of the checkboxes nor subsequent comboboxes. Just that one.
This is completely mysterious behavior, and I was wondering if someone could help me discover the cause.
Here is my source code (C-Sharp project files):
Form code: C++ code - 29 lines - codepad
Custom tab page code (TabPageIncludes.cs): C++ code - 62 lines - codepad
Custom list view code (ControlListView.cs): C++ code - 131 lines - codepad
Much appreciation to any help.
Last edited: