Just an FYI. The ISupportInitialize did solve my problem and did exactly
what I was looking for. By putting code in the EndInit of the control, it
"SQLScott" wrote:
> I appreciate all the feedback. Thank you.
>
> I heard that ISupportInitialize might solve my problem. Has anyone used
> that? Any thoughts as to how you have used it?
>
> Scott
>
> "Jared" wrote:
>
> > Thanks for the explanation Mick.
> > Jared
> >
> > "Mick Doherty"
> > <EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
> > message news:eUEIznlrEHA.1712@tk2msftngp13.phx.gbl...
> > > This was a response to your answer which stated:
> > >>I don't think you can do what you're asking, because there isn't an event
> > >>inside of a control that fires when it is added to a parent container.
> > >
> > > When you add a control to a container, that controls parent changes from
> > > Nothing (or it's previous container) to the Control that contains it, and
> > > it fires the ParentChanged event and the OnParentChanged method.
> > >
> > > \\\
> > > Protected Overrides Sub OnParentChanged(ByVal e As System.EventArgs)
> > > MyBase.OnParentChanged(e)
> > > If Me.Parent Is Nothing Then Return
> > > If Me.DesignMode = False Then
> > > MsgBox(Me.Parent.ToString)
> > > End If
> > > End Sub
> > > ///
> > >
> > > I'm not exactly sure what Scott is trying to do, but it sounds like he
> > > could even use the New() method of his control.
> > >
> > > --
> > > Mick Doherty
> > >
http://dotnetrix.co.uk/nothing.html > > >
> > >
> > > "Jared" <ask_me_for_it@nospam.com> wrote in message
> > > news:10mgllbpa069b0@corp.supernews.com...
> > >> Mick,
> > >> Can you elaborate for my benefit? How does this let you know only when
> > >> a control has been loaded in a parent container only? Thanks,
> > >> Jared
> > >>
> > >> "Mick Doherty"
> > >> <EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote
> > >> in message news:uAdgoTkrEHA.1036@TK2MSFTNGP10.phx.gbl...
> > >>> You could use the OnParentChanged method.
> > >>>
> > >>> --
> > >>> Mick Doherty
> > >>>
http://dotnetrix.co.uk/nothing.html > > >>>
> > >>>
> > >>> "Jared" <ask_me_for_it@nospam.com> wrote in message
> > >>> news:10mgfnujfud4860@corp.supernews.com...
> > >>>> I don't think you can do what you're asking, because there isn't an
> > >>>> event inside of a control that fires when it is added to a parent
> > >>>> container. You can use the controladded event in the parent form, but,
> > >>>> you are no better off than form_load.
> > >>>>
> > >>>> You can inherit from the combobox and set the additional values when
> > >>>> they are set.
> > >>>> For example, lets say you want to add items to the combo box, but only
> > >>>> if the back color is red. You can set the back color to red, and, in
> > >>>> the property set definition you can provide the additional logic.
> > >>>>
> > >>>> I could be wrong, as often I am, but, others will help to point out any
> > >>>> shortfalls in my thinking.
> > >>>> HTH,
> > >>>> Jared
> > >>>>
> > >>>> Public Class MyCombo
> > >>>> Inherits ComboBox
> > >>>>
> > >>>> Sub New()
> > >>>> MyBase.New()
> > >>>> ' Add items to the combo box here.
> > >>>> End Sub
> > >>>>
> > >>>> Protected Overrides Sub RefreshItem(ByVal index As Integer)
> > >>>> MyBase.RefreshItem(index)
> > >>>> End Sub
> > >>>>
> > >>>> Protected Overrides Sub SetItemsCore(ByVal items As
> > >>>> System.Collections.IList)
> > >>>> MyBase.SetItemsCore(items)
> > >>>> End Sub
> > >>>>
> > >>>> Public Overrides Property BackColor() As Color
> > >>>> Get
> > >>>> Return MyBase.BackColor
> > >>>> End Get
> > >>>> Set(ByVal Value As Color)
> > >>>> MyBase.BackColor = Value
> > >>>> If Value.Equals(Color.Red) Then
> > >>>> ' Set some additional values for the control.
> > >>>> MsgBox("You choose red")
> > >>>> Else
> > >>>> ' Remove items here
> > >>>> End If
> > >>>> End Set
> > >>>> End Property
> > >>>> End Class
> > >>>>
> > >>>> "SQLScott" <SQLScott@discussions.microsoft.com> wrote in message
> > >>>> news:8152D156-316F-497A-B367-FC5A0B03607F@microsoft.com...
> > >>>>> Forgive me if this seems trivial, but any and all help is greatly
> > >>>>> appreciated, and I will attempt to explain this as best I can.
> > >>>>>
> > >>>>> I have created a combo and added a certain number of properties to it.
> > >>>>> When
> > >>>>> I place that combo on a form, I set any number of those properties.
> > >>>>>
> > >>>>> What I would like to happen is during the load of the COMBO BOX, not
> > >>>>> the
> > >>>>> form, I would like to see what properties are set on the combo and
> > >>>>> populate
> > >>>>> the combo with data depending on what properties are set.
> > >>>>>
> > >>>>> Yes, I could do this on the load of the FORM, but then I would have to
> > >>>>> write
> > >>>>> code on each and every FORM_LOAD that I place the combo on.
> > >>>>>
> > >>>>> I know there is not an CONTROL_LOAD method, but is there an equivalent
> > >>>>> that
> > >>>>> I can use so that no matter how many forms I drop this combo on, the
> > >>>>> code is
> > >>>>> already with the combo, and all I have to do is set the properties?
> > >>>>>
> > >>>>> I sincerely hope this made sense.
> > >>>>>
> > >>>>> --
> > >>>>> Thanks,
> > >>>>>
> > >>>>> Scott
> > >>>>
> > >>>>
> > >>>
> > >>>
> > >>> ---
> > >>> Outgoing mail is certified Virus Free.
> > >>> Checked by AVG anti-virus system (
http://www.grisoft.com).
> > >>> Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004
> > >>>
> > >>
> > >>
> > >
> > >
> > > ---
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system (
http://www.grisoft.com).
> > > Version: 6.0.742 / Virus Database: 495 - Release Date: 20/08/2004
> > >
> >
> >