Unknown control in a mdiformchild

  • Thread starter Thread starter Morpheu
  • Start date Start date
M

Morpheu

Hello,
I have other problem with the unknown control added at runtime:
When i use a mdiformchild, the control don't appear.
In a normal form, it works.

Somebody?

Thank you in advance.
Morpheu
 
* "Morpheu said:
I have other problem with the unknown control added at runtime:
When i use a mdiformchild, the control don't appear.
In a normal form, it works.

What is an unknown control? How do you add it?!
 
I have a function (by Fergus):
Public Function MakeControl (sTypeName As String) As Control
Dim sFormTypeName As String = GetType (Form).AssemblyQualifiedName
sTypeName = sFormTypeName.Replace ("Form,", sTypeName & ",")
Dim oType As Type = Type.GetType (sTypeName)
Return DirectCast (Activator.CreateInstance (oType), Control)
End Function

And have the code:
Dim c as control
for i = 0 to 5
c=MakeControl(colControl(i).StringControl)
'In this point i put values in properties of the control
me.controls.add(c)
'HERE the control don't appear in my form.
next

How can i resolve ?

Morpheu
 
Hi Morpheu,

I'm assuming that c is coming back as a correct Control because you're
able to set its properties. This leaves the question as to where you are doing
this - ie. what is 'me' in the code - the MdiForm or the child Form?

If it's the main Form then that will be the problem. If it' the child Form
then you may need to post more code.

Regards,
Fergus
 
Hello,
I gave silly thing.
Beginer's thing.
Scale is different from VB6 for VB.NET.

Thank you.
Morpheu
 
Hi again,

No, maybe not - if you mean the Controls are scaled off the Form.

Regards,
Fergus
 
Back
Top