Windows Forms and PowerPoint

Add-in Express™ Support Service
That's what is more important than anything else

Windows Forms and PowerPoint
Using PowerPoint events in a Windows Form 
Don Duckworth


Guest


I'm writing a powerpoint com add-in that uses a windows form dialog.

I have powerpoint events in my 'AddinModule.vb'

A button on my ADXRibbonTab1 opens a windows form dialog box, Form1

When I click button1Click on Form1, I want to read and set PowerPoint Events from 'Form1.vb'

How do I include the PowerPoint events in the 'Form1.vb' file.

or

How do I call a function in 'AddinModule.vb' from 'Form1.vb' as this would also work as I pass values from Form1 to the function and return nothing after the PowerPoint Events have been processed.

Thanks for any help.

Don
Posted 15 Nov, 2012 17:58:35 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello Don,

If that form is shown as non-modal, event handlers of the ADXPowerPointAppEvents located on the module can call corresponding methods in the form. If the form is shown modally, it is impossible to use Add-in Express components to intercept these events.

There's a problem with non-modals however: they usually interfere with the windowing of the host application. This is often seen in tooltips, keyborad shorcuts and in other areas. If this is your case, consider using a pane instead.

To call a method defined in the add-in module, you use the CurrentInstance property of the module as follows:

MyAddin1.AddinModule.CurrentInstance.MyMethod()


Andrei Smolin
Add-in Express Team Leader
Posted 16 Nov, 2012 00:58:10 Top
Don Duckworth


Guest


Thank you for your assistance Andrei.

I was using a non-modal form. I still could not figure out how to call the PowerPoint Events.

With your advice I was able to use the Function method using the CurrentInstance property. I could use it in both modal and non-modal dialogs.

Thanks again for your assistance.

Don
Posted 16 Nov, 2012 15:38:04 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello Don,

Don Duckworth writes:
I still could not figure out how to call the PowerPoint Events.


The event handlers of the PowerPoint Events component should call methods defined in your form, if the form is shown.


Andrei Smolin
Add-in Express Team Leader
Posted 19 Nov, 2012 02:19:53 Top