المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : how to link a radio button to a command button? (mfc c++)



C++ Programming
07-30-2009, 05:40 AM
good day,

here is my problem on how to link the commandbutton to radio buttons (mfc) in c++:

i inserted 3 radiobuttons inside a groupbox with a caption "Mode of payments";

radio1 with a caption "1. Cash (10% discount)";
radio2 with a caption "2. Two payments (5 % interest)";
radio3 with a caption "3. Three payments (10% interest);

i also have two editboxes; editbox1 and editbox2.

1. with a static text "enter tuition fee:" value will be accepted in the first editbox.
2. with a static text "Your total tuition fee is:" will be displayed in the second editbox.

and one command button with a caption "Compute"

supposing i will select the second radio button which is "two payments (5% interest)" upon clicking
the command button "compute" the result should be displayed in the second editbox under "your total tuition
fee:" which is the computation on the value of the first editbox and on the second radiobutton and so on...

if i will not use a commandbutton "compute" caption (to do the calculation) i can do the code and get the right result by
calculating the value of the first editbox and on the radiobutton values, but when i will use commandbutton to do
the calculation on the value of the first editbox to the radiobuttons that is now my problem since i cannot link the radiobuttons
and the commandbutton...


Please anybody help me in solving this problem...i need sample code as guide in solving this problem and on my future related
projects...

code experts please help me...


thank again and thank you in advance...

neil