I am developing mobile application in C#. I am using the keyboard launch functionality to launch the keyboard on mobile device when one of the textbox gets focused. I am using the following code.
private void inputPanel1_EnabledChanged(object sender, EventArgs e)
{
InputEnabled();
}
private void InputEnabled()
{
int y;
if (inputPanel1.Enabled)
// SIP visible - position label just above the area covered by the input panel
y = Height - inputPanel1.Bounds.Height;
else
// SIP not visible - position label just above bottom of form
y = Height;
// Calculate the position of the top of the label
//y = y - mainPanel.Height;
//this.Dock = DockStyle.Top;
//mainPanel.Location = new Point(0, y);
this.Size = new Size(this.Size.Width, y);
this.AutoScroll = true;
//this.AutoScrollPosition = new Point(this.AutoScrollPosition.X, descriptionTextBox.Location.Y);
}
In the above code I am trying to change the height of windows form dynamically. I have added breakpoint in my application. In the following statement
this.Size = new Size(this.Size.Width, y);
I can see the value of y gets changed to 180 in right side. But in the left side the value of this this.Size remains unchanged. I am totally unaware why this is happening. Can you please tell me is anything wrong in my code or can you provide me the solution so that the value of height in the this.size statement on the left side gets changed ?