Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hey everyone,
i am trying too use a tabControl panel to put multiple features in a single form.
how can i make a button inside a tab clickable? it seems as if the button is not active when its being clicked from inside its parent tab.
how can i make the button active from inside the tab container?
notes:
i tryied to place a call for the button inside the tabPage, but then - when i clicked the button nothing happened, but when i clicked somewhere random inside the tab itself the button activity started.
buttons decleration + tabcontrol decleration:
// a button to add the associated views to the right listbox (listbox2)
private void button1_Click(object sender, EventArgs e)
{
listBox2.Items.Clear();
selectedItemText = listBox1.SelectedItem.ToString();
selectedItemIndex = listBox1.SelectedIndex;
foreach(Level lev in levels)
{
if(lev.Name == selectedItemText)
{
pickedLevel = lev;
}
}
foreach(Element view in views)
{
View v = view as View;
if (v.GenLevel != null)//check if the view is indeed a level
{
if (v.ViewType == ViewType.CeilingPlan && v.GenLevel.Name == pickedLevel.Name)//check if the plan is cielling, and if it has the same level as chosen
{
listBox2.Items.Add(v.Name);
}
}
}
dataBindings();
}
// set the listbox1 back
private void dataBindings()
{
listBox1.DataSource = null;
listBox1.DataSource = levelNames;// string list
}
// button to clear the right listbox
private void button2_Click(object sender, EventArgs e)
{
listBox2.Items.Clear();
dataBindings();
}
// the tab decleration--> what goes here?
private void tabPage1_Click(object sender, EventArgs e)
{
}
thanks!
Solved! Go to Solution.