| | |
select value from check box
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 28
Reputation:
Solved Threads: 2
0
#3 Oct 18th, 2009
The example below will retrieve the value of a checkbox and display it in a messagebox on a button click event.
C# Syntax (Toggle Plain Text)
if (checkBox1.Checked) { MessageBox.Show(checkBox1.Text.ToString()); }
•
•
Join Date: Jul 2009
Posts: 940
Reputation:
Solved Threads: 154
1
#4 Oct 18th, 2009
It wasn't clear to me whether your question was for obtaining the state, as you have already been directed, or you are wanting to set the state, which I will throw out some additional direction below.
If you search on these, you should be able to find all the example code you need to see/understand how these are implemented in a form.
Cheers!
C# Syntax (Toggle Plain Text)
// ListBox method to select an item... public void SetSelected(int index, bool value); public ListBox.SelectedObjectCollection SelectedItems { get; } // to see all items selected... // and, to capture when the selection is changing: public event EventHandler SelectedIndexChanged; // RadioButton method to get/set state: public bool Checked { get; set; } // and, to capture when the state has been changed: public event EventHandler CheckedChanged; // ComboBox methods to select item: public override int SelectedIndex { get; set; } public object SelectedItem { get; set; } // and, to capture when the selection has changed: public event EventHandler SelectedIndexChanged;
If you search on these, you should be able to find all the example code you need to see/understand how these are implemented in a form.
Cheers!
Last edited by DdoubleD; Oct 18th, 2009 at 1:12 pm.
![]() |
Similar Threads
- Header Check box in data grid view is not working (C#)
- how to active and inactive an account using check box??? (PHP)
- query and check box (yes/no) (Visual Basic 4 / 5 / 6)
- Check box validation (PHP)
- Flash check box (Graphics and Multimedia)
- check box problem (VB.NET)
- check box and label (C#)
- I have problem with check box (PHP)
- select check boxes (ASP.NET)
Other Threads in the C# Forum
- Previous Thread: select value from datagrid
- Next Thread: source code for detecting caller id
| Thread Tools | Search this Thread |
Tag cloud for box, check, combo, listbox
access ajax array asp asp.net box bug bugs button c# cast check checkbox click code codebox combo countryselector daniweb data database dependent dialog dropdownlist dropdownmenu exists form forms glitch header http input insert java javascript listbox module mysql net post preview problem reuse save select string table textbox timer txt validation visualstudio web webprogramming







