collection, kind of MDI

C

chriske

I'm a newbee student at VB.net so bear with me,

is it possible to make a collection from a tabpage inside the
tabcontrol so that I can make a new instance containing all the labels
and textboxes and so on ?
it's about a score board for Yahtzee (yes, this is a school exercise
d;p) that I like to copy for each player

thnx
 
O

One Handed Man [ OHM# ]

Define how you see the game being played in a little bit more detail. And
then illuminate how you are trying to us the UI to this effect.


Regards - OHM#



I'm a newbee student at VB.net so bear with me,

is it possible to make a collection from a tabpage inside the
tabcontrol so that I can make a new instance containing all the labels
and textboxes and so on ?
it's about a score board for Yahtzee (yes, this is a school exercise
d;p) that I like to copy for each player

thnx

Regards - OHM# (e-mail address removed)
 
H

Herfried K. Wagner [MVP]

* chriske said:
I'm a newbee student at VB.net so bear with me,

is it possible to make a collection from a tabpage inside the
tabcontrol so that I can make a new instance containing all the labels
and textboxes and so on ?

it's about a score board for Yahtzee (yes, this is a school exercise
d;p) that I like to copy for each player

Create a UserControl with the controls placed on it and instantiate it
when adding a tabpage. Then add the control to the tabpage
('TabPageX.Controls.Add(...)').
 
C

chriske

"Herfried K. Wagner [MVP]" a écrit
Create a UserControl with the controls placed on it and instantiate it
when adding a tabpage. Then add the control to the tabpage
('TabPageX.Controls.Add(...)').
I've been looking into this "user control" but it seems to far reached
for what I need
as you can create a form with buttons and textboxes and so on and then
make a new instance in the sub main of the project so would I like to
do this with a tabpage
only the difference is that a tabpage is already inside another
container, the tabcontrol, can I create just the one tabpage and simply
make a copy from the first already containing al the existing controls
but with another name on the tab ?

how I loved the control arrays of VB6, now I seem to have to learn
another way to create several instances of the same object and also
looping through this collection seems unnecessary difficult now

thnx
 
H

Herfried K. Wagner [MVP]

* chriske said:
only the difference is that a tabpage is already inside another
container, the tabcontrol, can I create just the one tabpage and
simply make a copy from the first already containing al the existing
controls but with another name on the tab ?

I still don't understand. Maybe you want to place the controls directly
on the form (not inside a tabpage), then move them over the tabcontrol
and bring them in the foreground this can be done in the IDE by using
commands from the control's context menu or by calling the control'
'BringToFront' method.
how I loved the control arrays of VB6, now I seem to have to learn
another way to create several instances of the same object and also
looping through this collection seems unnecessary difficult now

Which collection do you want to loop through?
 
C

chriske

"Herfried K. Wagner [MVP]" a écrit
I still don't understand. Maybe you want to place the controls directly
on the form (not inside a tabpage), then move them over the tabcontrol
and bring them in the foreground this can be done in the IDE by using
commands from the control's context menu or by calling the control'
'BringToFront' method.
I hardly can't place the same controls over and over again on the main
form or on the same tabpage ? it's about kind of a card holding all the
values of each combination of dices, this has to be displayed
separately for each player

has anyone here heard about the dice game Yahtzee ? :D
Which collection do you want to loop through?

this was meant as a general remark, I simply loved how I could make an
array of buttons in VB6 and assign events using their index inside a
select statement, how to do this in VB.Net ?

thnx
 
H

Herfried K. Wagner [MVP]

* chriske said:
I hardly can't place the same controls over and over again on the main
form or on the same tabpage ? it's about kind of a card holding all
the values of each combination of dices, this has to be displayed
separately for each player

I still don't know what you want to do. Do you want to display the same
data in certain controls regardless of the tab currently selected? Do
you want to "share" certain controls between some tabs?
this was meant as a general remark, I simply loved how I could make an
array of buttons in VB6 and assign events using their index inside a
select statement, how to do this in VB.Net ?

There is no 1:1 replacement, but this article will describe how to mimic
the behavior in VB.NET:

Creating Control Arrays in Visual Basic .NET and Visual C# .NET
<http://msdn.microsoft.com/library/?...ngControlArraysInVisualBasicNETVisualCNET.asp>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top