MDI workspace first View Position

Topics: CAB & Smart Client Software Factory
Jan 10, 2006 at 3:54 AM
originally posted by: pmelichar1809

I will demonstrate my problem on the BankTellerEx02 solution from Hands on labs. I want to display first view in first workitem (in this case sideBarView) for example in the centre of MDIWorkspace..

when I modify BankTellerWorkitemCode.cs code (look for //added code!! below), there is no reaction and the view is displayed in the upper left corner in the MDI window, please help. How can I display this workitem in the centre of mdi window? Petr Melichar.

public void Show(IWorkspace mainWorkspace)
{
this.mainWorkspace = mainWorkspace;

//Needs to be named because it will be used in a placeholder
this.Items.AddNew<UserInfoView>("UserInfo");
SideBarView sideBarView = this.Items.AddNew<SideBarView>();

AddMenuItems();

WindowSmartPartInfo inf = new WindowSmartPartInfo();
inf.Title = "BankTeller - Customer Queue";
inf.ControlBox = false;
inf.Location = new System.Drawing.Point(100, 0); //added code!!
mainWorkspace.Show(sideBarView, inf);
this.Activate();
}