Re: ComboBox - How to stop firing Select Index Event on Load
From: Rick (rfemmer_at_cmsstl.com)
Date: 02/16/05
- Next message: pearsons_11114: "Re: User control constituent controls not accessible in designer"
- Previous message: Troy: "Re: ComboBox - How to stop firing Select Index Event on Load"
- In reply to: Troy: "Re: ComboBox - How to stop firing Select Index Event on Load"
- Next in thread: Ken Halter: "Re: ComboBox - How to stop firing Select Index Event on Load"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Feb 2005 15:09:28 -0600
That works just as well, and seeing this is .net I believe I'll do it the
".Netters" way.
Thanks For the Help!
"Troy" <Troy@fmsinc.com> wrote in message
news:ehkopdGFFHA.1296@TK2MSFTNGP10.phx.gbl...
> The ".Netters" do it like this:
>
> Remove the "Handles XYZ" from the end of your SelectedIndexChanged Event.
>
> It now looks like this:
>
> Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object,
> ByVal e As System.EventArgs)
>
> End Sub
>
> In the load event of the form, add this line of code AFTER you do your
> binding:
> AddHandler ComboBox1.SelectedIndexChanged, AddressOf
> ComboBox1_SelectedIndexChanged
>
>
> --
> Troy
>
>
> Troy Munford
> Development Operations Manager
> FMS, Inc.
> www.fmsinc.com
>
>
> "Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
> news:%23EHhVSGFFHA.2452@TK2MSFTNGP09.phx.gbl...
> Not sure how the ".Netters" do it, but in VB6, you'd either create a
boolean
> called "Loading" (or whatever), set that in Form_Load to True while
loading
> and False right before the End Sub. In the event handler for the control,
> check that flag before processing. If True, just exit.
>
> --
> Ken Halter - MS-MVP-VB - http://www.vbsight.com
> Please keep all discussions in the groups..
>
> "Rick" <rfemmer@cmsstl.com> wrote in message
> news:%23LywyVEFFHA.2832@TK2MSFTNGP14.phx.gbl...
> I am binding a dataset to a ComboBox(Code Below) which causes the
> SelectedIndexChanged event to fire for every record added to the combobox,
I
> would like to add code to populate a form based on the selectedvalue but I
> don't want to fire this code when binding the data to the combobox. Can
> anyone tell me how to work around this?
>
> cboMembers.DataSource = ds.Tables(0)
> cboMembers.DisplayMember = ds.Tables(0).Columns(0).ToString()
> cboMembers.ValueMember = ds.Tables(0).Columns(1).ToString()
>
> Thanks in Advance,
> Rick
>
>
>
- Next message: pearsons_11114: "Re: User control constituent controls not accessible in designer"
- Previous message: Troy: "Re: ComboBox - How to stop firing Select Index Event on Load"
- In reply to: Troy: "Re: ComboBox - How to stop firing Select Index Event on Load"
- Next in thread: Ken Halter: "Re: ComboBox - How to stop firing Select Index Event on Load"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|