Acmlm's Board - I2 Archive - Programming - An interesting problem; keeping track of tabs and arrays. [Visual Basic 6]
User | Post |
Jesper
Posts: 45/2390 |
Originally posted by TFG
Originally posted by Jesper But, as the topic says, I'm writing this in Visual Basic 6, so I can't create multiple windows from a template (to the best of my knowledge anyway), and thus I'll have to do it in one window with a couple of tabs.
You can create multiple instances of any object/control/window in Visual Basic like this:
Dim newForm as Form
Set newForm = New Form1 newForm.Show
Each new form will have the same functionality as its base/parent form.
I prefer tabs over multiple windows. Take FireFox as an example
I know how to create new instances (how do you think I duplicate the controls inside?) but I'm just not sure if it's gonna work with forms, since I don't think they have the Index property. |
Mega-Dog
Posts: 17/139 |
I did it at 1 time in my NES Database program...I could look in the source and possibly post it...there is a way just to remove the tab and then I think all of them automaticly move... |
TFG
Posts: 1/7 |
Originally posted by Jesper But, as the topic says, I'm writing this in Visual Basic 6, so I can't create multiple windows from a template (to the best of my knowledge anyway), and thus I'll have to do it in one window with a couple of tabs.
You can create multiple instances of any object/control/window in Visual Basic like this:
Dim newForm as Form
Set newForm = New Form1 newForm.Show
Each new form will have the same functionality as its base/parent form.
I prefer tabs over multiple windows. Take FireFox as an example
|
Jesper
Posts: 38/2390 |
Originally posted by dan When you delete an index from the tab sheet, you could call a For loop that loops from the number of tabs down to the index, subtracting 1 from each tab's index. I don't know if you already tried it, but that seems the most logical solution. That's what I ended up doing... For i = Index + 1 To TabStrip1.Tabs.Count TabStrip1.Tabs.Item(i - 1) = TabStrip1.Tabs.Item(i) Next i I still have to sync a few variables to the new i but that's just a few more for-loops for those (in some cases) and embedding them in the above loop (in other cases). |
dan
Posts: 4/782 |
When you delete an index from the tab sheet, you could call a For loop that loops from the number of tabs down to the index, subtracting 1 from each tab's index. I don't know if you already tried it, but that seems the most logical solution. |
Jesper
Posts: 25/2390 |
I don't think you get the problem here. I know how to remove a tab, I just want to turn the other tab IDs down a notch when I do remove one, and do the same for the arrays I have going.
Anyway, I'm looking into user-defined types and collections. But still, keep it coming. |
Tuvai
Posts: 27/211 |
Originally posted by Chaosflare there is other tabs that automatically work, but then if the other person doesnt have the ocx then they need it That's what setting References and using Package & Deployment wizard is for. |
Sokarhacd
Posts: 50/1757 |
there is other tabs that automatically work, but then if the other person doesnt have the ocx then they need it, if you wanna know which just ask and ill tell you |
HyperLamer
Posts: 18/8210 |
I could never get tabs working, I had to use a listbox. |
Jesper
Posts: 23/2390 |
So! I got this instant messaging program I made going. What's cool about it is that you just open it up on two computers in the same network and they will appear in a list automatically. No connection setups, no servers, no firewalls to worry about. Anyway, that's not what I needed help with.
As this will allow a few people to be online simultaneously, like AIM or ICQ, I'll want you to be able to chat with multiple people at the same time. But, as the topic says, I'm writing this in Visual Basic 6, so I can't create multiple windows from a template (to the best of my knowledge anyway), and thus I'll have to do it in one window with a couple of tabs.
I've got the generating tabs stuff working, but I'm going to need some help with wiring down the infrastructure for keeping track of the convo IDs and tab IDs. Right now everything's ruled by the tab index numbers (I -think- this is the only way to do array keys in VB) and so I'll need a few lines of code to make it able to remove a tab anywhere in the array (and subtract the whole bunch of controls at the same time).
Any takers? |
|