Create control at runtime with process


G

Guest

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_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOpenFile.Clic
Dim thInitForm As New Thread(AddressOf InitForm
Tr
ofdDocWord.ShowDialog(Me
If Not ofdDocWord.FileName = "" The
wdDoc = New Word.DocumentClas
wdApp = New Word.ApplicationClas
wdDoc = wdApp.Documents.Open(ofdDocWord.FileName
fct.FormMe = M
thInitForm.Start(
tbcGeneral.Enabled = Tru
End I
Catc
MsgBox(Err.GetException.ToString
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.StartupPath & "\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.InitFormulaire(
End Su

someone have an idea

Thanks
 
Ad

Advertisements


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