>local lcFile >lcFile = getfile('pdf') >if not empty(m.lcFile) > thisform.newobject("olecontrol1","olecontrol") && ,"","","AcroPDF.PDF.1") > with thisform.olecontrol1 >* .OLEClass = "AcroPDF.PDF.1" > .top = 48 > .left = 12 > .height = 392 > .width = 500 > .loadfile(m.lcFile) > .setzoom(100) > .setShowToolbar(.f.) > .visible = .t. > endwith >endif>
>PUBLIC oform1 > >oform1=NEWOBJECT("form1") >oform1.Show > >RETURN > > > >********************************************************** >DEFINE CLASS form1 AS form > > DoCreate = .T. > Caption = "pdfForm" > Name = "Form1" > > > > ADD OBJECT cmdfile AS commandbutton WITH ; > Top = 12, ; > Left = 12, ; > Height = 27, ; > Width = 144, ; > Caption = "Select File", ; > Name = "cmdFile" > > ADD OBJECT cmdTP AS commandbutton WITH ; > Top = 12, ; > Left = 250, ; > Height = 27, ; > Width = 100, ; > Caption = "TimePass", ; > Name = "cmdTimePass" > > ADD OBJECT cmdexit AS commandbutton WITH ; > Top = 12, ; > Left = 168, ; > Height = 27, ; > Width = 84, ; > Caption = "E\<xit", ; > Name = "cmdExit" > > ADD OBJECT olecontrol1 AS olecontrol WITH ; > OLEClass = "AcroPDF.PDF.1", ; > Top = 48, ; > Left = 12, ; > Height = 192, ; > Width = 348, ; > Name = "Olecontrol1" > > PROCEDURE Init > ThisForm.ReSize() > ENDPROC > > PROCEDURE Resize > ThisForm.Olecontrol1.Height = ThisForm.Height - 60 > ThisForm.Olecontrol1.Width = ThisForm.Width - 24 > ThisForm.Olecontrol1.Refresh() > ENDPROC > > PROCEDURE cmdfile.Click > LOCAL cFile > cFile = GETFILE([PDF]) > IF !EMPTY(cFile) > THISFORM.oleControl1.LoadFile(cFile) > THISFORM.olecontrol1.OBJECT.setZoom(10) > THISFORM.olecontrol1.setShowToolbar (.T.) > > ENDIF > ENDPROC > > PROCEDURE cmdTimePass.Click > thisform.olecontrol1.OBJECT.setZoom(100) > thisform.olecontrol1.OBJECT.setPageMode(3) > thisform.olecontrol1.setShowToolbar (.F.) > > ENDPROC > > > PROCEDURE cmdexit.Click > ThisForm.Release() > ENDPROC > >ENDDEFINE >>