| | |
Ratio in C# HOW??
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2007
Posts: 8
Reputation:
Solved Threads: 0
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
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
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";
}
}
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";
}
}
•
•
Join Date: Sep 2007
Posts: 8
Reputation:
Solved Threads: 0
•
•
•
•
I don't really get what you mean. Maybe if you said what kind of calcculation you mean, andhow the ratio factors in
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???
![]() |
Similar Threads
- Google:Supplemental Index Ratio (Search Engine Optimization)
- Memberships / Unique Visitors Ratio??? (Social Media and Online Communities)
- Tell us about yourself! (Community Introductions)
- aspect ratio? (Monitors, Displays and Video Cards)
- Registrations at TTF (Social Media and Online Communities)
- Is 300:1 contrast typical for a 15in LCD? (Monitors, Displays and Video Cards)
- Screwy Domain (DaniWeb Community Feedback)
Other Threads in the C# Forum
- Previous Thread: Microsoft Visual Studio 2005 web
- Next Thread: vector addition
| Thread Tools | Search this Thread |
.net access ado.net algorithm array asp.net barchart bitmap box broadcast buttons c# check checkbox client color combo combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees developer development draganddrop drawing encryption enum event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener mandelbrot math mouseclick mysql nargalax operator path photoshop picturebox pixelinversion post programming radians regex remote remoting restore richtextbox save saving serialization server sleep socket sql stack statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






