PC Review


Reply
Thread Tools Rate Thread

auto fire of items events on initilization (check/radio buttons)

 
 
Brian Henry
Guest
Posts: n/a
 
      31st Mar 2004
How can you stop the check changed event from fireing during the
initilization of a form? I have about 4 radio and check boxes on the form,
and when the form is initilizing, the one that is marked as checked during
the initilization (when InitializeComponent is called) always fires it's
check changed event, which I don't want it do to.. how can you prevent this?
thanks


 
Reply With Quote
 
 
 
 
Domenico Daraio
Guest
Posts: n/a
 
      31st Mar 2004
you want don't view the chacked, you can setting for all radio or check
enable false...

bye
domenico


"Brian Henry" <brianiup[nospam]@adelphia.net> ha scritto nel messaggio
news:(E-Mail Removed)...
> How can you stop the check changed event from fireing during the
> initilization of a form? I have about 4 radio and check boxes on the form,
> and when the form is initilizing, the one that is marked as checked during
> the initilization (when InitializeComponent is called) always fires it's
> check changed event, which I don't want it do to.. how can you prevent

this?
> thanks
>
>



 
Reply With Quote
 
Brian Henry
Guest
Posts: n/a
 
      31st Mar 2004
did that still fired, this is in a user control by the way


"Domenico Daraio" <(E-Mail Removed)> wrote in message
news:NXzac.17713$(E-Mail Removed)...
> you want don't view the chacked, you can setting for all radio or check
> enable false...
>
> bye
> domenico
>
>
> "Brian Henry" <brianiup[nospam]@adelphia.net> ha scritto nel messaggio
> news:(E-Mail Removed)...
> > How can you stop the check changed event from fireing during the
> > initilization of a form? I have about 4 radio and check boxes on the

form,
> > and when the form is initilizing, the one that is marked as checked

during
> > the initilization (when InitializeComponent is called) always fires it's
> > check changed event, which I don't want it do to.. how can you prevent

> this?
> > thanks
> >
> >

>
>



 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      31st Mar 2004
Hi Brian,

I think we all do that with a flag/bool/switch whatever you name that, that
you set at the end of the load form event to true. This is the most wide
solution I've seen in this newsgroups for that.

I hope that helps?

Cor


 
Reply With Quote
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      31st Mar 2004
Hi,

There is no way to prevent the event from happening. Here is a
possible work around.

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles CheckBox1.CheckedChanged

Static bIgnore As Boolean = True

If Not bIgnore Then

' Your code goes here

Debug.WriteLine("Checked changed")

End If

bIgnore = False

End Sub



Ken
----------------
"Brian Henry" <brianiup[nospam]@adelphia.net> wrote in message
news:(E-Mail Removed)...
> How can you stop the check changed event from fireing during the
> initilization of a form? I have about 4 radio and check boxes on the form,
> and when the form is initilizing, the one that is marked as checked during
> the initilization (when InitializeComponent is called) always fires it's
> check changed event, which I don't want it do to.. how can you prevent

this?
> thanks
>
>



 
Reply With Quote
 
Brian Henry
Guest
Posts: n/a
 
      31st Mar 2004
that's pretty much my hack i had in place, was hopeing there was a switch i
was missing that did it already

"Cor" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi Brian,
>
> I think we all do that with a flag/bool/switch whatever you name that,

that
> you set at the end of the load form event to true. This is the most wide
> solution I've seen in this newsgroups for that.
>
> I hope that helps?
>
> Cor
>
>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      31st Mar 2004
* "Brian Henry" <brianiup[nospam]@adelphia.net> scripsit:
> How can you stop the check changed event from fireing during the
> initilization of a form? I have about 4 radio and check boxes on the form,
> and when the form is initilizing, the one that is marked as checked during
> the initilization (when InitializeComponent is called) always fires it's
> check changed event, which I don't want it do to.. how can you prevent this?
> thanks


Add the handler to the event after changing the state. Have a look at
the 'AddHandler' and 'RemoveHandler' keywords.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Menu items as radio buttons RBrowning1958@gmail.com Microsoft C# .NET 4 6th Nov 2007 05:52 PM
check boxes as radio buttons =?Utf-8?B?cm9zZQ==?= Microsoft Word Document Management 2 26th Oct 2005 07:54 PM
Events doesn't fire up for buttons in a web usercontrol - Help KK Microsoft ASP .NET 0 22nd Jan 2005 12:22 PM
Check boxes and radio buttons =?Utf-8?B?bF9hbmRyb21lZGFfbA==?= Microsoft Word Document Management 0 21st Oct 2004 05:41 PM
Adding buttons to a datagrid doesn't fire its events Andrés Giraldo Microsoft Dot NET 0 19th Sep 2003 04:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:32 PM.