Dynamic list and texboxes
I need to find a nice way to create something like this:
Component 1
Component 1 - Part 1
Component 1 - Part 2
Component 1 - Part 3
Component 1
Component 2 - Part 1
Component 2 - Part 2
Component 2 - Part 3
Every line contains 3 listboxes and 1 textbox.
The number of parts is decided after a user inserts a value into a textbox. If he changes the number, the number of parts should be changed aswell.
I have 16 components which is a fixed number, the number of parts can vary between 1 and 16.
What would be the best way to do this?
Re: Dynamic list and texboxes
Ok, IF, and that is a big if, I understand what you are talking about, assign 16 to a variable. In the textChanged event of the textboxes, make the text an integer (I don't remember exactly what this is in vb... maybe parseInt?) and subtract that number from your sixteen. Use error code to make sure that the variable does not get below zero. This may seem kinda sketchy, but I don't have time right now for a full explanation. By the time I get back here, if this doesn't help, I'm sure someone else can give you an example.
1 Attachment(s)
Re: Dynamic list and texboxes
Here you have an example of what I think you want to do.
This can be achieved using Control Arrays and I demonstrate how to do it in the attachment.
Please tell us if this solves your problem, if it does then add a (Resolved) to the title of your thread or change the icon to the green checkmark (or both). Thank you.
1 Attachment(s)
Re: Dynamic list and texboxes
I was reading again what you posted and I am not quite sure if what I attached before will do what you want.
So here I attach another project. Maybe both are a part of what you are seeking for. I don't know, you would have to check.
In this project I add I try to recreate what you say about the list in your post (When you click on the "Advanced..." button) But I must admit I didn't understand all what you wanted. If none of what I proposed is what you are after, please let us know.
Re: Dynamic list and texboxes
Okay thanks a lot! :thumb:
This is a much better way than I figured out myself. Especially the advanced mode that's very nice.
I was thinking about generating textboxes and stuff. Which would leave me up with over 250 textboxes, which wouldn't be very clear for a user.
Re: Dynamic list and texboxes