>I apologize if this is in the wrong discussion group. I have a C++ form
>(VS2003) that includes a couple text boxes and a slider bar. Moving the
>slider bar changes a picture that is displayed and some label elements and
>the text boxes have an initial value of 0. When a value is typed into the
>text boxes I want it to be saved based on the position of the slider bar. I
>am assuming that I need to write that text to the array
Here is some sample code of the array
static CListOfTeams *Team[] = __gc new CListOfTeams*[22];
private: System::Void Form1_Load(System::Object * sender,
System::EventArgs * e)
{
Team[0] = new CListOfTeams;
Team[0]->Team = S"Cleveland Browns";
Team[0]->Week = S"Pre-Season Week 1";
I want to save it here //Team[0]->Score = 16;
//Team[0]->Allowed = 12;
Team[0]->TeamPic = S"8080146.jpg";
Team[0]->Sched = S"6:30pm August 11 at Cleveland";
//Team[0]->Wins = 16;
//Team[0]->Loss = 12;
Team[1] = new CListOfTeams;
Team[1]->Team = S"Miami Dolphins";
Team[1]->Week = S"Pre-Season Week 2";
//Team[1]->Score = 11;
//Team[1]->Allowed = 10;
Team[1]->TeamPic = S"8080155.jpg";
Team[1]->Sched = S"7:00pm August 16 at KC";
//Team[1]->Wins = 27;
//Team[1]->Loss = 22;
> >I apologize if this is in the wrong discussion group. I have a C++ form
> >(VS2003) that includes a couple text boxes and a slider bar. Moving the
[quoted text clipped - 6 lines]
>
> Dave
Here is some sample code of the array
static CListOfTeams *Team[] = __gc new CListOfTeams*[22];
private: System::Void Form1_Load(System::Object * sender,
System::EventArgs * e)
{
Team[0] = new CListOfTeams;
Team[0]->Team = S"Cleveland Browns";
Team[0]->Week = S"Pre-Season Week 1";
I want to save it here //Team[0]->Score = 16;
and here //Team[0]->Allowed = 12;
Team[0]->TeamPic = S"8080146.jpg";
Team[0]->Sched = S"6:30pm August 11 at Cleveland";
Team[1] = new CListOfTeams;
Team[1]->Team = S"Miami Dolphins";
Team[1]->Week = S"Pre-Season Week 2";
//Team[1]->Score = 11;
//Team[1]->Allowed = 10;
Team[1]->TeamPic = S"8080155.jpg";
Team[1]->Sched = S"7:00pm August 16 at KC";
private: System::Void trackBar1_Scroll(System::Object * sender,
System::EventArgs * e)
{
int CurPos = this->trackBar1->Value - 1;
this->lblTxtTeam->Text = this->Team[CurPos]->Team;
this->lblTxtWeek->Text = this->Team[CurPos]->Week;
this->txtScored->Text = this->Team[CurPos]->Score.ToString();
this->txtAllowed->Text = this->Team[CurPos]->Allowed.ToString();
this->lblSched->Text = this->Team[CurPos]->Sched;
this->pictureBox2->Image = Drawing::Image::FromFile(Team[CurPos]->TeamPic);
this->lblTtlAllowed->Text = this->Team[CurPos]->Wins.ToString();
this->lblTtlScored->Text = this->Team[CurPos]->Loss.ToString();
}
Hope this helps.
> >I apologize if this is in the wrong discussion group. I have a C++ form
> >(VS2003) that includes a couple text boxes and a slider bar. Moving the
[quoted text clipped - 6 lines]
>
> Dave
David Lowndes - 04 Nov 2007 22:11 GMT
>Here is some sample code of the array
OK, so your slider position reflects the index to this array of items?
In essence you need to know (either read it from the slider control or
save it in a member variable) the current position (index) of the item
you're displaying, and in the appropriate events (save button press &
change of scroll position) copy the current values from the text
fields back to that item of the array.
Dave
Throwme A Frigginbone - 04 Nov 2007 22:43 GMT
Correct. The initial value of say position 2 is 0 & 0. If I change them to 14
& 12, the next time I return to position 2 the values should be 14 & 12. I'm
just not certain of how to do this. Still kinda new to C++.
Thanks
> >Here is some sample code of the array
>
[quoted text clipped - 7 lines]
>
> Dave