944,028 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 2126
  • C# RSS
Dec 3rd, 2007
0

Ratio in C# HOW??

Expand Post »
Hello All

I have created a form which as two group boxes, in each of these group boxes I have 8 radio buttons in each labeled 1 to 8 and the group boxes are named Up for the first box and Down for the second box. and I also have two picture boxes with labels Old Colour and New Colour. What I'm trying to achieve but failing is that when I choose a radio button from the Up Group Box say number 4 radio button and in the Down Group Box say number 2 I need to find away to create a calculation that will do a ratio of both of radio buttons selected to the value of (4:1) and (1:4) is this possible and any ideas would be grateful.

Thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
partyanimal is offline Offline
8 posts
since Sep 2007
Dec 3rd, 2007
0

Re: Ratio in C# HOW??

I don't really get what you mean. Maybe if you said what kind of calcculation you mean, andhow the ratio factors in
Featured Poster
Reputation Points: 975
Solved Threads: 140
Posting Virtuoso
scru is offline Offline
1,624 posts
since Feb 2007
Dec 3rd, 2007
0

Re: Ratio in C# HOW??

define an array or simply 2 variables.

If you will click a button after your selections, check the .Checked property of radio buttons using for example a foreach loop.

If you want your variables to change right upon clicking the radio button, you can use the following method in the CheckChanged events of the radio buttons as below

void CheckChanged(object sender, EventArgs e)
{
RadioButton radioBtn = (RadioButton)sender;
string myVal;

if (radioBtn.Checked)
{
myVal = "radioBtn.Text";
}
}
Reputation Points: 11
Solved Threads: 7
Light Poster
yagiD is offline Offline
35 posts
since Dec 2007
Dec 5th, 2007
0

Re: Ratio in C# HOW??

Click to Expand / Collapse  Quote originally posted by scru ...
I don't really get what you mean. Maybe if you said what kind of calcculation you mean, andhow the ratio factors in
Thanks for your reply

Well what it is I have a total of 16 radio buttons 8 in each column I would like to do a calculation that allows the user when clicked on a radio button in the first column it say 4 and in the second column the user clicks 0 then a picture box is coloured orange if the ratio is more than 4.

If this ain't possible could it be possible to have two buttons one saying Up and the second one saying Down and with then number of clicks on the up and the number of clicks down it can give us a ratio of more than 4 and less than 4 so this can promote or demote the colour in a picture box??

Does this make sence???
Reputation Points: 10
Solved Threads: 0
Newbie Poster
partyanimal is offline Offline
8 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Microsoft Visual Studio 2005 web
Next Thread in C# Forum Timeline: vector addition





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC