954,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

combo box problem..

i am new to programming.. i am now facing a prolem on how to turn the value in the combo box by automatically by using visual c++ 6. let's say the value in the combo box is 5, after i click a button, the value will increase to 10, 15 and so on. i hope somebody can help me out. I know this is easy but i can't figure out how to write this..

lifei
Newbie Poster
11 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

You should post some code to show us that you've tried something. Generally we're a lot more helpful if we see some effort...

twomers
Posting Virtuoso
1,877 posts since May 2007
Reputation Points: 453
Solved Threads: 57
 

I think there is lack of something in the below source code, however, i can't solve it..

int level;

	level = m_strvalue;
	
	level =5;
	PlaySound("3000_0_2.wav",NULL,SND_FILENAME);

	Sleep(1000);
	

	int iResults;
	iResults= MessageBox("Can You hear the tone?",
		"Response Dialog",
		MB_YESNO|MB_ICONINFORMATION);
	switch(iResults)
	{
	case IDNO:
		level = level+5;
	
	break;

	case IDYES:
	MessageBox("Test is completed!");
	break;
	}
}
lifei
Newbie Poster
11 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

[confused]How does the code you posted relate to your original question? [/confused]

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

the source code that i posted above is roughly about how my program run. the main problem that i face now is i dont know how to increase the level value of the combo box by 5 automatically each time i press the "no" button. each level will play different kind of tone.

lifei
Newbie Poster
11 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 
the source code that i posted above is roughly about how my program run. the main problem that i face now is i dont know how to increase the level value of the combo box by 5 automatically each time i press the "no" button. each level will play different kind of tone.

I don't see the connection between your level and what you are trying to do with sound...
What do you do with this level variable except

level+=5;
zhelih
Junior Poster
114 posts since Sep 2007
Reputation Points: 9
Solved Threads: 11
 

Two more things. Can you post the code in which you use this level variable and why do you need combo box except list box? For me list box is more useful in this situation!

zhelih
Junior Poster
114 posts since Sep 2007
Reputation Points: 9
Solved Threads: 11
 

void CToneDlg::OnPre()

{
// TODO: Add your control notification handler code here

//Get the current values from the screen
UpdateData(TRUE);

strtone = atoi(m_strcombo);

strtone=0;
PlaySound("3000_0_2.wav",NULL,SND_FILENAME);

Sleep(1000);

loop:
int iResults;
iResults= MessageBox("Can You hear the tone?",
"Response Dialog",
MB_YESNO|MB_ICONINFORMATION);

switch(iResults)
{
case IDNO:

strtone = strtone + 5;


if(strtone == 5){
PlaySound("3000_5_2.wav",NULL,SND_FILENAME);
}
else if(strtone == 10){

PlaySound("3000_10_2.wav",NULL,SND_FILENAME);
}
else if(strtone == 15){

PlaySound("3000_15_2.wav",NULL,SND_FILENAME);
}
else if(strtone == 20){
PlaySound("3000_20_2.wav",NULL,SND_FILENAME);
break;
}
goto loop;
break;

case IDYES:
m_sResults ==strtone;
MessageBox("Test is completed!");
}

UpdateData(FALSE);

}
the above source code is the latest one..however, i still unable to control the value in the combo box. if i want to write out the final value of the tone being played in the edit box, is it possible i just write m_sResults==strtone?
Hope somebody can give me some guide line..thanks..

lifei
Newbie Poster
11 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You