TabControl & ComboBox

  • Thread starter Thread starter Rajesh Abraham
  • Start date Start date
R

Rajesh Abraham

Need to have same ComboxBox in two Tab Pages of a Tab
Control so that both pages would exhibit same behavour for
Combo events.

Modifying the InitializeComponent() to add the combo to
both the pages did not work. However dynamically adding
the Combo to the selected page on
tabControl1_SelectedIndexChanged event worked. Is this the
right approch?

Can I have two seperate combo and sort of set one equal to
the other so that both Combos exhibit same behaviour for
its events with out duplicating the code (event handlers
etc)


Thanks,

Rajesh Abraham Chacko
 
You can reset the ComboBox Parent property to be the TabControls SelectedTab
property in the SelectedIndexChnaged event

eg.

Private Sub TabControl_SelectedIndexChanged(byval sender as object, byval e
as EventArgs) Handles TabControl.SelectedIndexChanged
ComboBox.Parent = TabControl.SelectedTab
EndSub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top