|
-
Apr 12th, 2007, 06:40 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] CheckBox [] problem
here is my problem, i create 5 CheckBoxes at the runtime
and i added a new EventHandler for CheckStateChanged the problem is when i click on the checkbox there is nothing to identify this one only
is there is any possible way to process the EventHandeler only on the checkbox only that i clicked
thanks alot
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Apr 12th, 2007, 06:51 PM
#2
Re: CheckBox [] problem
Every event handler has a 'sender' argument. The sender is always a reference to the object that raised the event. In your event handler do this:
C# Code:
CheckBox cbx = sender as CheckBox;
if (cbx != null)
{
// Use cbx here.
}
-
Apr 12th, 2007, 07:49 PM
#3
Thread Starter
Frenzied Member
Re: CheckBox [] problem
well, thanks alot jmcilhinney
it is woking fine
i have another question if you can help
i wanna remove a cotrol on a form i try but you know
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Apr 12th, 2007, 08:02 PM
#4
Re: [RESOLVED] CheckBox [] problem
Please ask unrelated questions in separate threads. One thread per topic and one topic per thread.
To add a control to a container, e.g. a Form, you call the Add method of the container's Controls collection, e.g. Me.Controls.Add. To remove a control from a container you would...
Make sure you dispose the control also if you're finished with it.
-
Apr 12th, 2007, 08:05 PM
#5
Thread Starter
Frenzied Member
Re: [RESOLVED] CheckBox [] problem
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|