[dba-VS] Using RemoveHandler in a Combobox Base Class

Charlotte Foust charlotte.foust at gmail.com
Thu Jun 4 23:55:14 CDT 2015


What I meant was test for a condition in that  SelectedIndexChanged event
and then either cancel the event or handle it normally.  Is there a
condition you could test for in that event so you would know whether to
allow it to continue?

Charlotte Foust
(916) 206-4336

On Wed, Jun 3, 2015 at 2:00 PM, Dan Waters <df.waters at outlook.com> wrote:

> Hi Charlotte,
>
> I will add the handler back in a few lines of code down.
>
> What do you mean 'branching the code'?
>
> Dan
>
> -----Original Message-----
> From: dba-VS [mailto:dba-vs-bounces at databaseadvisors.com] On Behalf Of
> Charlotte Foust
> Sent: Wednesday, June 03, 2015 3:40 PM
> To: Development in Visual Studio
> Subject: Re: [dba-VS] Using RemoveHandler in a Combobox Base Class
>
> Why remove the handler rather than branching the code in it?
>
> Charlotte Foust
> (916) 206-4336
>
> On Wed, Jun 3, 2015 at 8:09 AM, Dan Waters <df.waters at outlook.com> wrote:
>
> > I have a combobox base class (a custom control) which will cause the
> > combobox to drop down when the control is entered and the
> > selectedindex =
> > -1
> > (it's empty).  This is a convenience for users.
> >
> >
> >
> > However, I recently discovered that when the combobox is dropped down,
> > its SelectedIndexChanged event also fires, which I want to prevent. In
> > the code behind the form, I can just use
> >
> >
> >
> > RemoveHandler cboName.SelectedIndexChanged, AddressOf
> > cboName_SelectedIndexChanged
> >
> >
> >
> > But in the base class, I don't know how to specify what the address is
> > for the combobox on the form.
> >
> >
> >
> > This is where I'm stuck:
> >
> > RemoveHandler, Me.SelectedIndexChanged, AddressOf [What is the
> > address?]
> >
> >
> >
> > How can this be done?
> >
> >
> >
> > Thanks!
> >
> > Dan
> >
> >
> >
> > _______________________________________________
> > dba-VS mailing list
> > dba-VS at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/dba-vs
> > http://www.databaseadvisors.com
> >
> _______________________________________________
> dba-VS mailing list
> dba-VS at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vs
> http://www.databaseadvisors.com
>
> _______________________________________________
> dba-VS mailing list
> dba-VS at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vs
> http://www.databaseadvisors.com
>


More information about the dba-VS mailing list