| | |
Problem in checkboxes set
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
are you using a checked list box? if so this might help you a lot:
Computers are man's attempt at designing a cat: It does whatever it wants, whenever it wants, and rarely ever at the right time.
Hello :
Thanks for all answers but my ponit was :
group1 : checkbox1 checkbox2 checkbox3
group2 : checkbox4 checkbox5 checkbox6
all inside the form , I want to make a test function , make a test with the checked item and the item is against it , if checkbox2 is checked and checkox5 is checked too a messagebox appear , display a text ....etc
if not an error meassagebox appear ..etc not just checkbox 2&5 may be inside the form there are 50 checkbox's I can't in each item make a comperision .....can any one help???
Thanks in advance...
Thanks for all answers but my ponit was :
group1 : checkbox1 checkbox2 checkbox3
group2 : checkbox4 checkbox5 checkbox6
all inside the form , I want to make a test function , make a test with the checked item and the item is against it , if checkbox2 is checked and checkox5 is checked too a messagebox appear , display a text ....etc
if not an error meassagebox appear ..etc not just checkbox 2&5 may be inside the form there are 50 checkbox's I can't in each item make a comperision .....can any one help???
Thanks in advance...
•
•
Join Date: Nov 2006
Posts: 436
Reputation:
Solved Threads: 72
Hello Aminit,
Just a thought... have you considered using a binary value to represent each group ?
Set the Tag value for each checkbox with a hex value. Have a method OR the hex values for each checkbox (method will iterate through all checkboxes in a group) resulting in a single value for each group.
Hint: if you have each checkbox group contained in a panel or groupbox it makes it easier to iterate all checkboxes in that container rather than filter on all checkboxes on the form.
Once you have a single binary value for each checkbox group. You can (AND) the value with the other group(s) to see which combinations are checked as a single value.
If you have some known conditions (like that one which creates an error message), then you can AND that condition (as a binary value) to the checkbox group binary values.
Its just a matter of math.
If this sounds confusing, consider it this way. If you can represent Group A as a single value, then you can use simple boolean operators to compare against specific conditions you want to check.
// Jerry
Just a thought... have you considered using a binary value to represent each group ?
Set the Tag value for each checkbox with a hex value. Have a method OR the hex values for each checkbox (method will iterate through all checkboxes in a group) resulting in a single value for each group.
Hint: if you have each checkbox group contained in a panel or groupbox it makes it easier to iterate all checkboxes in that container rather than filter on all checkboxes on the form.
Once you have a single binary value for each checkbox group. You can (AND) the value with the other group(s) to see which combinations are checked as a single value.
If you have some known conditions (like that one which creates an error message), then you can AND that condition (as a binary value) to the checkbox group binary values.
Its just a matter of math.
If this sounds confusing, consider it this way. If you can represent Group A as a single value, then you can use simple boolean operators to compare against specific conditions you want to check.
// Jerry
![]() |
Similar Threads
- Problem: Deleting with chk in DataList (ASP.NET)
- checkboxes (PHP)
- Recent problem: Slowdown, viruses of some sort, and many other things. (Viruses, Spyware and other Nasties)
- Help with computer problem Please (Viruses, Spyware and other Nasties)
- virus problem!!! (Viruses, Spyware and other Nasties)
- Problem with wx.TreeCtrl (Python)
- lsass problem... (Viruses, Spyware and other Nasties)
- Problem with very basic homework... (It's done, but have one bug I can't figure out.) (Java)
- checkboxes on continuous forms (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: how to import a csv file to sql server 2005 database table using C#
- Next Thread: C# Delete key
Views: 2872 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ httpwebrequest image index input install java label list listbox listener login math mouseclick mysql networking object operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






