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
 
Back
Top