activate event not fired ? ?

G

Guest

hi there
here is my problem :
there is a main form (frmMain) which calls a searchForm (frmSearch). Then i
select an item (from the returned ones) and open a third form (frmData).
Taking from there i can either :
A. open a fourth form (frmComment) which is just a textbox and a button (and
should return the text entered in the textbox into frmData)
B. open a word document ,and paste its contents into a richtextbox in frmData
The problem is that whichever i do, the frmData 's activated Event isn't
fired when i clos frmComment or the word Application.
shouldn't it be the case ?
 
C

Cor Ligthert

Juststarter

Are it
MDI forms
or
Showdialog forms
or
Forms all showed separatly and all in the same time active on the screen ?

Cor

"juststarter"
 
G

Guest

frmSearch and frmData are mdi children ( frmSearch.mdiparent = frmMain,
frmData.mdiparent = frmMain) and are loaded using the show() method.
frmComments is non mdi and is shown using showDialog().
 
C

Cor Ligthert

Juststarter,

When the fromComment is showed
dim frmComment as new formComment
frmComment.showdialog
'Here is where should the operation go on when frmComment closes.

However there is in my opinion no reason for an activated event, it is
already active.

For your word application it is very dependend how you start it.
When it is with process.start you can set a

http://msdn.microsoft.com/library/d...emdiagnosticsprocessclasswaitforexittopic.asp

To get the same behaviour

I hope this helps?

Cor
 
G

Guest

this is how i start the word application

Dim fileName As String
Dim wordapp As Word.Application
Dim document As Word.Document
fileName = Application.StartupPath & "\wordDocuments\templates\template.dot"
wordapp = New Word.Application
wordapp.Visible = True
wordapp.Activate()
document = wordapp.Documents.Open(fileName)

the strange thing is that the same code is also used in another form
(suppose there is as frmData2 which does the same thing (aka : opening a word
doc or opening an frmConnect form) but in the later case the code in the
activated event (of frmData2 form) is executed

do u think i should use system.diagnostics.process.start("....") ? how can i
get the process handle so that i use the waitForExit ?
i have tried
system.diagnostics.process.start("....")
a = system.diagnostics.process.getcurrentprocess
but this returns the process of my vb project :(

thx for your time:)
 
C

Cor Ligthert

JustStarter,

I did a long time no word interop, so for that part you can probably better
start a new thread in this newsgroup, word interop is not a form however an
application.

My advices would certainly not be the best for that.

Cor
 

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