Unknown control in a mdiformchild

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
 
H

Herfried K. Wagner [MVP]

* "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?!
 
M

Morpheu

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
 
F

Fergus Cooney

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
 
M

Morpheu

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

Thank you.
Morpheu
 
F

Fergus Cooney

Hi again,

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

Regards,
Fergus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top