Create control at runtime with process

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric

    #1

    Create control at runtime with process

    Hi

    I want to know if it's possible to create a control at runtime in a different process than the main form

    There is a fonction I try but I have a message that tell me I can create control on the parent process

    Public sub cmdOpenFile_Cli ck(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles cmdOpenFile.Cli c
    Dim thInitForm As New Thread(AddressO f InitForm
    Tr
    ofdDocWord.Show Dialog(Me
    If Not ofdDocWord.File Name = "" The
    wdDoc = New Word.DocumentCl as
    wdApp = New Word.Applicatio nClas
    wdDoc = wdApp.Documents .Open(ofdDocWor d.FileName
    fct.FormMe = M
    thInitForm.Star t(
    tbcGeneral.Enab led = Tru
    End I
    Catc
    MsgBox(Err.GetE xception.ToStri ng
    wdApp.Quit(
    wdDoc = Nothin
    End Tr
    End su

    Public Sub InitForm(
    'function to init all the information to create contro
    fct.Var = fct.InitVarTab( Application.Sta rtupPath & "\Variable" , wdApp
    'pass the parent control to the other clas
    fct.AddObjTemp( tbcGeneral
    'create the control on the parent control (here is a TabControl
    fct.InitFormula ire(
    End Su

    someone have an idea

    Thanks
Working...