Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / November 2007

Tip: Looking for answers? Try searching our database.

Saving location and data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Throwme A Frigginbone - 04 Nov 2007 03:49 GMT
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, but I am not sure if
that is right. I want it to save it when a Save button is pressed or the
slider position changes. Any help would be appreciated, Thanks
David Lowndes - 04 Nov 2007 14:23 GMT
>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

What array?

Dave
Throwme A Frigginbone - 04 Nov 2007 18:23 GMT
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
Throwme A Frigginbone - 04 Nov 2007 18:27 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.