PC Review


Reply
Thread Tools Rate Thread

collection, kind of MDI

 
 
chriske
Guest
Posts: n/a
 
      14th Dec 2003
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


 
Reply With Quote
 
 
 
 
One Handed Man [ OHM# ]
Guest
Posts: n/a
 
      14th Dec 2003
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#




chriske wrote:
> 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 Removed)


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      14th Dec 2003
* chriske <(E-Mail Removed)> scripsit:
> 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(...)').

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
chriske
Guest
Posts: n/a
 
      14th Dec 2003
"Herfried K. Wagner [MVP]" a écrit
> * chriske <(E-Mail Removed)> scripsit:
>> 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(...)').

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


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      14th Dec 2003
* chriske <(E-Mail Removed)> scripsit:
> 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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
chriske
Guest
Posts: n/a
 
      14th Dec 2003
"Herfried K. Wagner [MVP]" a écrit
> * chriske <(E-Mail Removed)> scripsit:
>> 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.
>

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 ?

>> 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?


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


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      14th Dec 2003
* chriske <(E-Mail Removed)> scripsit:
>>> 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.
>>

> 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?

>> 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 ?


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/?url=/library/en-us/dv_vstechart/html/vbtchCreatingControlArraysInVisualBasicNETVisualCNET.asp>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection problems (create Collection object, add data to collection, bind collection to datagrid) Øyvind Isaksen Microsoft ASP .NET 1 18th May 2007 10:24 AM
Collection problems (create Collection object, add data to collection, bind collection to datagrid) Øyvind Isaksen Microsoft Dot NET 1 18th May 2007 10:24 AM
Any kind of sorted container(collection) where key is not unique? German Koninin Microsoft Dot NET 1 2nd Feb 2006 12:23 PM
Can't get collection to save when using collection of custom class as property of control in VS 2005 J.Edwards Microsoft Dot NET Compact Framework 0 10th Jan 2006 04:44 AM
key/value collection that allows key string to be updated and retains collection item entry order dx Microsoft Dot NET Framework 2 25th Sep 2004 05:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:50 PM.