//Swith page between "Map" and "PageLayout".
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) {
if (tab_control.SelectedIndex == 0) { //Switch to the Map View page.
toolbar.SetBuddyControl(map);
toc.SetBuddyControl(map);
}
else if (tab_control.SelectedIndex == 1) { //Switch to the PageLayout page.
toolbar.SetBuddyControl(page_layout);
toc.SetBuddyControl(page_layout);
}
}
private void FormMain_Load(object sender, EventArgs e) {
//Set the Map as the buddies for the ToolBar and TOCControl.
toolbar.SetBuddyControl(map);
toc.SetBuddyControl(map);
}The license initializer initializes the ArcGIS (engine runtime, advanced etc.) that is necessary to use ArcObjects components. Without a license attempting to use ArcObjects classes will fail.
I am not sure I follow. The license initializer may or may not be used in your code. Typically that gets added to the project when you use an esri template. I don't know what type of project, form, console, library you have. It might be called in the application initialization events, in the main function of a class or in the load of a form. The best thing is to search for references to it in your code.