保存位置和数据 [英] Saving location and data

查看:50
本文介绍了保存位置和数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果这是在错误的讨论组中,我道歉。我有一个C ++表格

(VS2003),包括几个文本框和一个滑动条。移动

滑块会更改显示的图片和一些标签元素以及文本框的初始值为0.当一个值输入到
文本框我想根据滑块的位置保存它。我假设我需要将该文本写入数组,但是我不确定

是否正确。我希望它在按下Save按钮或

滑块位置发生变化时保存。任何帮助将不胜感激,谢谢

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

推荐答案

>如果这是在错误的讨论组,我道歉。我有一个C ++表格
>I apologize if this is in the wrong discussion group. I have a C++ form

>(VS2003),包括几个文本框和一个滑动条。移动
滑块会更改显示的图片和一些标签元素以及文本框的初始值为0.当在
文本框中键入一个值时,我想要它根据滑块的位置保存。我假设我需要将该文本写入数组
>(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



什么数组?


Dave

What array?

Dave


以下是数组的一些示例代码

静态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"季前第1周;

我想在这里保存//团队[0] - >得分= 16;

//团队[0] - > ;允许= 12;

团队[0] - > TeamPic = S" 8080146.jpg" ;;

团队[0] - > Sched = S" 6: 8月11日下午30点在克利夫兰" ;;

//团队[0] - >胜利= 16;

//团队[0] - >损失= 12;


团队[1] =新的CListOfTeams;

团队[1] - > Team = S" Miami Dolphins";

团队[1] - >周= S" P.重赛季第2周;

//团队[1] - >分数= 11;

//团队[1] - >允许= 10;

团队[1] - > TeamPic = S" 8080155.jpg" ;;

团队[1] - > Sched = S" 7:00pm 8月16日在KC" ;

//团队[1] - >胜利= 27;

//团队[1] - >损失= 22;

David Lowndes写道:
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;
"David Lowndes" wrote:

如果这是在错误的讨论组中,我道歉。我有一个C ++表格

(VS2003),包括几个文本框和一个滑动条。移动

滑块会更改显示的图片和一些标签元素以及文本框的初始值为0.当一个值输入到
文本框我想根据滑块的位置保存它。我假设我需要将该文本写入数组
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



什么数组?


Dave


What array?

Dave


以下是数组的一些示例代码

静态CListOfTeams * Team [] = __gc new CListOfTeams * [ 22];

private:System :: Void Form1_Load(System :: Object * sender,

System :: EventArgs * e)

{

团队[0] =新的CListOfTeams;

团队[0] - > Team = S" Cleveland Browns" ;;

团队[0 ] - >周= S"季前第1周;

我想在此保存//团队[0] - >得分= 16;

在这里//团队[0] - >允许= 12;

团队[0] - > TeamPic = S" 8080146.jpg" ;;

团队[0 ] - > Sched = S" 8月11日下午6点30分在克利夫兰;

团队[1] =新的CListOfTeams;

团队[1] - >团队= S" Miami Dolphins" ;;

Team [1] - > Week = S" P重赛季第2周;

//团队[1] - >分数= 11;

//团队[1] - >允许= 10;

团队[1] - > TeamPic = S" 8080155.jpg" ;;

团队[1] - > Sched = S" 7:00pm 8月16日在KC" ;


private:System :: Void trackBar1_Scroll(System :: Object * sender,

System :: EventArgs * e)

{

int CurPos = this-> trackBar1-> Value - 1;

this-> lblTxtTeam-> Text = this-> Team [CurPos ] - >团队;

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();

}


希望这会有所帮助。

" David Lowndes"写道:
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.
"David Lowndes" wrote:

如果这是在错误的讨论组中,我道歉。我有一个C ++表格

(VS2003),包括几个文本框和一个滑动条。移动

滑块会更改显示的图片和一些标签元素以及文本框的初始值为0.当一个值输入到
文本框我想根据滑块的位置保存它。我假设我需要将该文本写入数组
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



什么数组?


Dave


What array?

Dave


这篇关于保存位置和数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆