5 Replies - 525 Views - Last Post: 15 October 2013 - 04:16 AM Rate Topic: -----

#1 inverse99  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 40
  • Joined: 07-September 13

Fill Comboboxes

Posted 14 October 2013 - 07:10 AM

i have 2 comboxes.,..,cbocourse and cboyearandsection

if i click BSIT on cbocurse then cboyearandsection will be automatically fill in without clicking any button except the selection of the index of cbocourse
  Dim BSIT() As String = {"1A", "1B", "1C", "2A", "2B", "2C", "3A", "3B", "3C", "4A", "4B"}
       If cbocourse.SelectedIndex = "BSIS" Then
            cboyear.Items.AddRange(BSIT)



Is This A Good Question/Topic? 0
  • +

Replies To: Fill Comboboxes

#2 ybadragon  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 276
  • View blog
  • Posts: 1,465
  • Joined: 11-May 12

Re: Fill Comboboxes

Posted 14 October 2013 - 07:14 AM

Ok, are you getting an error?
Was This Post Helpful? 0
  • +
  • -

#3 inverse99  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 40
  • Joined: 07-September 13

Re: Fill Comboboxes

Posted 14 October 2013 - 07:18 AM

where do i put the code
Was This Post Helpful? 0
  • +
  • -

#4 ybadragon  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 276
  • View blog
  • Posts: 1,465
  • Joined: 11-May 12

Re: Fill Comboboxes

Posted 14 October 2013 - 07:23 AM

you could put it in a multitude of locations, in a button_click event, in a selection_changed event, in a seperate sub which is then called in one of those events, it really depends on what exactly you want done.
Was This Post Helpful? 0
  • +
  • -

#5 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3730
  • View blog
  • Posts: 13,026
  • Joined: 12-December 12

Re: Fill Comboboxes

Posted 14 October 2013 - 08:28 AM

@OP It is unclear what you are asking. If you want help you'll need to explain your question more clearly and provide more information.
Was This Post Helpful? 0
  • +
  • -

#6 x-logan  Icon User is offline

  • D.I.C Head

Reputation: 15
  • View blog
  • Posts: 88
  • Joined: 18-April 13

Re: Fill Comboboxes

Posted 15 October 2013 - 04:16 AM

' ADDING ITEM TO cboyearandsection COMBOBOX

Private Sub add_combo()
      cboyearandsection.Items.Add("1A")
     cboyearandsection.Items.Add("1B") ' similarly you can add all you want to add

         END SUB

    Private Sub cbocourse_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbocourse.SelectedValueChanged
  if cbcourse.text = "BSIT"   
   CALL add_combo()
  end if
    End Sub


There are numerous ways but it depends on you how you want to proceed

This post has been edited by x-logan: 15 October 2013 - 04:20 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1