A
Andrei Csibi
I'm running a PowerPoint slide show in a Windows Form using the code shown at
the end (it might be useful for others that have tried to do this). The
problem is that when I resize the Form, hence the panelView which is docked
on the form, the PowerPoint is not displayed properly, I mean I want to be
FULLY displayed in the panel (some parts are not displayed), respecting the
proportions of the panel. How can I achive this?
Code:
this.SuspendLayout();
PowerPoint.Application app = new PowerPoint.Application();
pres = app.Presentations.Open(file, MsoTriState.msoFalse,
MsoTriState.msoFalse, MsoTriState.msoFalse);
pres.SlideShowSettings.ShowType =
PowerPoint.PpSlideShowType.ppShowTypeSpeaker;
PowerPoint.SlideShowWindow ssWindow =
pres.SlideShowSettings.Run();
ssWindow.Top = 0;
ssWindow.Left = 0;
ssWindow.Width = panelView.Width;
ssWindow.Height = panelView.Height;
// name.ppt is the name of the powerpoint file that should
be displayed
string pptTitle = @"PowerPoint Slide Show - [name.ppt]";
int screenClasshWnd = FindWindow(0, pptTitle);
SetParent(screenClasshWnd,
groupHomeworkPpPreview.Handle.ToInt32());
this.ResumeLayout();
the end (it might be useful for others that have tried to do this). The
problem is that when I resize the Form, hence the panelView which is docked
on the form, the PowerPoint is not displayed properly, I mean I want to be
FULLY displayed in the panel (some parts are not displayed), respecting the
proportions of the panel. How can I achive this?
Code:
this.SuspendLayout();
PowerPoint.Application app = new PowerPoint.Application();
pres = app.Presentations.Open(file, MsoTriState.msoFalse,
MsoTriState.msoFalse, MsoTriState.msoFalse);
pres.SlideShowSettings.ShowType =
PowerPoint.PpSlideShowType.ppShowTypeSpeaker;
PowerPoint.SlideShowWindow ssWindow =
pres.SlideShowSettings.Run();
ssWindow.Top = 0;
ssWindow.Left = 0;
ssWindow.Width = panelView.Width;
ssWindow.Height = panelView.Height;
// name.ppt is the name of the powerpoint file that should
be displayed
string pptTitle = @"PowerPoint Slide Show - [name.ppt]";
int screenClasshWnd = FindWindow(0, pptTitle);
SetParent(screenClasshWnd,
groupHomeworkPpPreview.Handle.ToInt32());
this.ResumeLayout();