expose the user name as a property, then use PropertyInfo's SetValue, for example        PropertyInfo Mypropertyinfo =  formType.GetProperty("Caption");        Mypropertyinfo.SetValue(
            formObj, "This caption has been changed.", null);
 seehttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemreflectionpropertyinfoclasssetvaluetopic.asp

解决方案 »

  1.   

    你的UserControl1的构造函数最好有一个参数,就是你的用户名
    然后
    Activator.CreateInstance是可以构造参数的
    比如说
    你的UserControl1
    的构造函数是
    public UserControl1(sring userName)
    {
    。。
    }
    那么Activator.CreateInstance如下调用
      

  2.   

    楼主也可以尝试一下这个object Portal = new object();
    Portal = Activator.CreateInstance( formType );
    MethodInfo info = type.GetConstructor(new Type[]{System.String}); Portal = Activator.CreateInstance( formType ); object[] args = new object[1];
    args[0] = UserName;
    Form ShowForm = (Form)info.Invoke( Portal,args )
      

  3.   

    Sorry!
    object Portal = new object();
    Portal = Activator.CreateInstance( formType );
    MethodInfo info = formType .GetConstructor(new Type[]{System.String}); object[] args = new object[1];
    args[0] = UserName;
    Form ShowForm = (Form)info.Invoke( Portal,args )