Click here to Skip to main content
16,011,482 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to delete files(txt) from vc++ program Pin
shiva shankar19-May-04 19:33
shiva shankar19-May-04 19:33 
AnswerRe: how to delete files(txt) from vc++ program Pin
bugtwo19-May-04 20:16
bugtwo19-May-04 20:16 
Generalproblem drawing stretched image Pin
nm_11419-May-04 19:11
nm_11419-May-04 19:11 
Generalvcpp6 keeps hanging Pin
closecall19-May-04 17:16
closecall19-May-04 17:16 
GeneralVisual Studio .NET vs old mfc class Pin
zecodela19-May-04 17:09
zecodela19-May-04 17:09 
GeneralRe: Visual Studio .NET vs old mfc class Pin
Christian Graus19-May-04 17:27
protectorChristian Graus19-May-04 17:27 
GeneralRe: Visual Studio .NET vs old mfc class Pin
Michael P Butler19-May-04 22:36
Michael P Butler19-May-04 22:36 
GeneralCombo Boxes and numbers Pin
Eversman19-May-04 16:56
Eversman19-May-04 16:56 
Hey, got another question.

I hace a combo box and an edit box, and in the combo box, there is options for time, 10 mins, 20 mins etc etc. And when you click on them, it adds it to the edit box and keesp track of the total, remeber there are 7, so you choose 7 values and it adds it up, but if you hit the wrong value and change to the other one it adds both values to the edit box, and you can't change it back without restarting the program.

<br />
int cur = m_type2.GetCurSel ();<br />
	CString text;<br />
	m_type2.GetLBText (cur, text);<br />
<br />
    <br />
	int cur1 = m_dur2.GetCurSel ();<br />
	CString text1;<br />
	m_dur2.GetLBText (cur1, text1);<br />
	if (text1 == "10 Minutes")<br />
	{<br />
		if (text == "Swimming #1" )<br />
		{<br />
			totalswim+=10;<br />
			totalrun+=0;<br />
			totalcycling+=0;<br />
			totalstrength+=0;<br />
		}<br />
		else<br />
		if (text == "Run #1" )<br />
		{<br />
			totalrun+=10;<br />
			totalswim+=0;<br />
			totalcycling+=0;<br />
			totalstrength+=0;<br />
		}<br />
		else<br />
		if (text == "Cycling #1" )<br />
		{<br />
			totalcycling+=10;<br />
			totalrun+=0;<br />
			totalswim+=0;<br />
			totalstrength+=0;<br />
		}<br />
		else<br />
		if (text == "Strength #1" )<br />
		{<br />
			totalcycling+=0;<br />
			totalrun+=0;<br />
			totalswim+=0;<br />
			totalstrength+=10;<br />
		}<br />
		else<br />
		if (text == "Stretching #1" )<br />
		{<br />
			totalswim+=0;<br />
			totalrun+=0;<br />
			totalcycling+=0;<br />
			totalstrength+=0;<br />
		}<br />
	Hours();	<br />
	}<br />
<br />
<br />
void CDEPDlg::Hours()<br />
{<br />
<br />
<br />
<br />
    CString str;<br />
    str.Format(TEXT("%i"),totalswim);<br />
    m_swimtime.SetWindowText (str);<br />
<br />
	CString str1;<br />
    str1.Format(TEXT("%i"),totalrun);<br />
    m_runtime.SetWindowText (str1);<br />
<br />
	CString str2;<br />
    str2.Format(TEXT("%i"),totalcycling);<br />
    m_cyclingtime.SetWindowText (str2);<br />
<br />
	CString str3;<br />
    str3.Format(TEXT("%i"),totalstrength);<br />
    m_strengthtime.SetWindowText (str3);<br />
<br />
}<br />


That is the code for it, if you have any ideas of how to have it to waht I need it to do, please post, becasue I am out of ideas and don't really know how else to do it.

Thanks
GeneralRe: Combo Boxes and numbers Pin
Mahendra_78619-May-04 21:33
Mahendra_78619-May-04 21:33 
GeneralRe: Combo Boxes and numbers Pin
Andrew Quinn AUS19-May-04 23:50
Andrew Quinn AUS19-May-04 23:50 
GeneralShowWindow() problem - MFC Pin
J.B.19-May-04 16:21
J.B.19-May-04 16:21 
GeneralRe: ShowWindow() problem - MFC Pin
nguyenvhn19-May-04 18:18
nguyenvhn19-May-04 18:18 
GeneralRe: ShowWindow() problem - MFC Pin
J.B.19-May-04 18:57
J.B.19-May-04 18:57 
GeneralRe: ShowWindow() problem - MFC Pin
*Dreamz20-May-04 2:23
*Dreamz20-May-04 2:23 
GeneralRe: ShowWindow() problem - MFC Pin
J.B.20-May-04 3:26
J.B.20-May-04 3:26 
GeneralRe: ShowWindow() problem - MFC Pin
*Dreamz20-May-04 3:34
*Dreamz20-May-04 3:34 
GeneralRe: ShowWindow() problem - MFC Pin
J.B.20-May-04 5:16
J.B.20-May-04 5:16 
GeneralRe: ShowWindow() problem - MFC Pin
*Dreamz20-May-04 19:21
*Dreamz20-May-04 19:21 
GeneralA probelm of launching excel from C++ Pin
xiaosongxia19-May-04 16:18
xiaosongxia19-May-04 16:18 
GeneralRe: A problem of launching excel from C++ Pin
Steve S19-May-04 22:37
Steve S19-May-04 22:37 
GeneralMFC and Menus Pin
Eversman19-May-04 16:16
Eversman19-May-04 16:16 
GeneralRe: MFC and Menus Pin
valikac19-May-04 18:31
valikac19-May-04 18:31 
GeneralRe: MFC and Menus Pin
Eversman20-May-04 2:45
Eversman20-May-04 2:45 
GeneralRe: MFC and Menus Pin
valikac20-May-04 5:21
valikac20-May-04 5:21 
GeneralRe: MFC and Menus Pin
Eversman20-May-04 9:36
Eversman20-May-04 9:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.