Active Tab/Panel Name

How do you determine programmatically the name of the active sheet/panel?

I have two panels and would like to know in code which panel is selected. I cannot believe I am not able to figure this out!!

1

As you can see in this example there are two sheets called ‘Consolidated’ and ‘Detail’.
How can I determine which one is selected? Keep in mind that some other controls might have the focus and not necessarily the tab itself.

Hey Samm,

Check the EpiGuid and the Name under Customization properties. Hope this helps.

Matthew Morgan

Hey Matthew,

Thanks for the info, I have already tried to use this information but I am not sure what property would tell me if the tab is selected.

1 Like

If you can determine which control has the focus/isactive
then I wonder if you could work backwards via parent(s) until you hit the panel that contains that control?

e.g. the thread below included a solution related to parents… looked interesting (to me):

1 Like

The post you linked was mine - I do it by keeping track of which tab is active, I don’t believe I was able to find a way to reliably get the active name otherwise.

private string currentViewID;

private void V_JobDashboard_1View_AfterRowChange(EpiRowChangedArgs args)
{			
	currentViewID = (oTrans.LastView).ViewName;
		
	EpiDataView dv = (EpiDataView)oTrans.EpiDataViews[currentViewID]; 
	foreach (PropertyInfo prop in dv.GetType().GetProperties())
    {
	   if(prop.Name == "Row")
	   {				
		    currentRowID = Convert.ToInt32(prop.GetValue(dv, null));
	   }			 
	}
}
4 Likes