I am writing Windows Mobile 6.5 Application for the first time for Motorola MC75 Devices.
I am using UserControls for each screens, and single "HomeForm", Problems I am facing are:-
- No Close button anwhere on device.
- No Keyboard (Input Panel) though I have written code using InputPanel on textbox got focus event but it is not working.
On Emulator both close button and keyboard panel shows-up.
following is the code which I uses to setup new UserControl and shows :
public static HomeForm HomeFormGet(string ControlName, object viewModel)
{
if (homeForm == null)
{
homeForm = new HomeForm();
}
BaseUserControl prevUserControl = homeForm.ActiveUserControl;
homeForm.ActiveUserControl = getUserControl(ControlName, homeForm);
if (viewModel != null)
{
homeForm.ActiveUserControl.Model = viewModel;
}
homeForm.ActiveUserControl.DBName = DBName;
homeForm.ActiveUserControl.UserName = UserName;
if (!string.IsNullOrEmpty(homeForm.ActiveUserControl.PrevUserControlName) && homeForm.activeUserControl.PrevUserControlName == prevUserControl.Name)
{
homeForm.activeUserControl.PrevUserControl = prevUserControl;
}
else
{
foreach (UserControl uCtl in controlsCache)
{
if (homeForm.activeUserControl.PrevUserControlName == uCtl.Name)
{
homeForm.activeUserControl.PrevUserControl = (BaseUserControl)uCtl;
break;
}
}
}
homeForm.ActiveUserControl.Location = new Point(0, 0);
//homeForm.activeUserControl.Size = new Size(homeForm.Width, homeForm.activeUserControl.Height);
//homeForm.activeUserControl.Dock = DockStyle.Fill;
homeForm.AutoScroll = true;
homeForm.ActiveUserControl.Show();
return homeForm;
}