User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 455,985 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,759 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 860 | Replies: 3
Reply
Join Date: Sep 2007
Posts: 8
Reputation: partyanimal is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
partyanimal partyanimal is offline Offline
Newbie Poster

Ratio in C# HOW??

  #1  
Dec 3rd, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2007
Location: St. Vincent and the Grenadines, Caribbean
Posts: 1,032
Reputation: scru is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 47
Featured Poster
scru's Avatar
scru scru is offline Offline
Veteran Poster

Re: Ratio in C# HOW??

  #2  
Dec 3rd, 2007
I don't really get what you mean. Maybe if you said what kind of calcculation you mean, andhow the ratio factors in
Reply With Quote  
Join Date: Dec 2007
Location: Iceland
Posts: 35
Reputation: yagiD is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
yagiD's Avatar
yagiD yagiD is offline Offline
Light Poster

Re: Ratio in C# HOW??

  #3  
Dec 3rd, 2007
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";
}
}
Reply With Quote  
Join Date: Sep 2007
Posts: 8
Reputation: partyanimal is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
partyanimal partyanimal is offline Offline
Newbie Poster

Re: Ratio in C# HOW??

  #4  
Dec 5th, 2007
Originally Posted by scru View Post
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???
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C# Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

All times are GMT -4. The time now is 9:28 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC