I’ve never really had a problem embedding containers in a Main Window and subsequently referencing the controls inside the window. I’ve always done this:
// Add the Lineup Setup container LUsetup = New LineupSetup LUsetup.EmbedWithin(wndMainWindow, 20, 20) oContainers.Append LUsetup // place container in array for future control oContainerIndex.Append("LUsetup") // add ability to ID each container in the array oContainers later
… where oContainers and oContainerIndex are global arrays and LUsetup is a property set as a container control
Then, when I need to reference any control inside the embedded container, I use:
// make sure the AddLineup portion of the LineupSetup container is not visible on opening for kdx As Integer = 0 to Ubound(oContainerIndex) if oContainerIndex(kdx) = "LUsetup" then LineupSetup(oContainers(kdx)).AddLineup1.Enabled = false end if next
In a new project, for the first time, I embedded the container in a tab panel like this:
// Add the "MainData" container to the current Tab Panel MainData = New cntMainData MainData.EmbedWithinPanel(tabStoreArea, tabStoreArea.Value, 4, 2) dataContainers.Append MainData // place container in array for future control dataContainerIndex.Append("MainData") // add ability to ID each container in the array inContainers later
However, when I try to access the controls inside the container cntMainData in the same manner as above, like this:
for kdx As Integer = 0 to Ubound(dataContainerIndex) if dataContainerIndex(kdx) = "MainData" then cntMainData(dataContainers(kdx)).lbxCaseInfo.RowTag(lbxCaseInfo.ListIndex) = "DOOR" end if next
… it doesn’t recognize the listbox control (lbxCaseInfo) which is in the cntMainData container control. The really bizarre thing is that when I look at the autocomplete list after
… it does show some of the controls in the container but not others! I can’t see any rhyme or reason to why some are recognized while others aren’t.
I’m completely bamboozled at the moment. Is there a difference between the way you do this with embedding the container in a window versus a tab panel that I’m missing???
My customer wants to see a demo of this application by week’s end and right now I’m completely stopped in my tracks! Thanks in advance for your help and consideration … Don