william

william

  • NA
  • 5
  • 0

c# textbox problem inside mdi parent

Jul 8 2008 5:19 AM
Hi guys,

Random problem here:

I have got a form inside a MDI Parent form using this code to make it 'floatable':

Code:
        private void btn_CustMaintenance_Click(object sender, EventArgs e)
{
frm_CustomerMaintenance oCustomerMaintenance = new frm_CustomerMaintenance();
oCustomerMaintenance.TopLevel = false;
this.Controls.Add(oCustomerMaintenance);
oCustomerMaintenance.StartPosition = FormStartPosition.CenterScreen;
oCustomerMaintenance.Show();
btn_CustMaintenance.Enabled = false;
}
When I add a textbox to the CustomerMaintenance form with some text in it, it acts very strangely. If you click on the text in the textbox, usually the text cursor thing would appear where you have clicked on the text, but it doesnt, it just goes to the left hand side of the text.

If I put a textbox on the MDI page though, then that textbox works correctly.

Has anyone else had this problem? If so, how did you sort it? If no-one has had this problem, would you try and simulate it and come up with a solution please?

I have been trying to sort this for a few weeks now and havent had a single reply on any of the 5 or 6 other forums that I have posted in.

8-(

William

Answers (5)