clicking a button inside tab control/ tab page - revit form

clicking a button inside tab control/ tab page - revit form

Or.levi
Contributor Contributor
538 Views
1 Reply
Message 1 of 2

clicking a button inside tab control/ tab page - revit form

Or.levi
Contributor
Contributor

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)
        {
            
            
              
        }

Orlevi_0-1647683129934.png

thanks!

0 Likes
Accepted solutions (1)
539 Views
1 Reply
Reply (1)
Message 2 of 2

Or.levi
Contributor
Contributor
Accepted solution

hey,

turns out that for some reason when i created new buttons and put them directly onto the tab it worked!

 

thanks !

0 Likes