Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling the Printer Setup (sys1037)
Message
 
To
06/10/1997 13:51:48
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00053068
Message ID:
00053433
Views:
30
>>>>>>>In my vfp50 program and in one of my menu options,
>>>>>>>I make a called to sys(1037) which is my Printer
>>>>>>>Setup function. The Printer Setup FORM opens,
>>>>>>>but it is not centered on the screen. Does anybody
>>>>>>>know how to center this FORM?
>>>>>>
>>>>>>Robert,
>>>>>>
>>>>>>I don't believe you can control the behavior of SYS(1037). However, if you were to use the Common Dialogs ActiveX control, you can (somewhat) control the positioning of the Printer Setup Dialog (it's the same one you get with SYS(1037)). It's (the dialog) position will be relative to the position of the control (even though the control is invisible). You also can retrieve information from it (something you can't do with the SYS() function).
>>>>>>
>>>>>>HTH.
>>>>>>
>>>>>>George
>>>>>Hi George and thanks for answering.. Would you please give
>>>>>me an example of how to use the Common Dialogs ActiveX
>>>>>control... thanks ... :)
>>>>
>>>>Robert,
>>>>
>>>>It's really rather simple. Create a form with .Visible, .ControlBox, .MaxButton, .MinButton all equalling .F. Drop the Common Dialogs control on it. Give the form a name, like DlgsForm. The position of the form/control will dictate where on the screen it will appear. It will be to the right and below it. Then save it to a class library with an appropriate name, say, CmmnDlgs. Now once the class library is set, use:
>>>>
>>>>oDlgs = CREATEOBJECT("CmmnDlgs")
>>>>
>>>>Set the flags to display the printer setup, rather than Page Setup.
>>>>
>>>>oDlgs.DlgsForm.Flags = 64
>>>>
>>>>To display the printer setup dialog: oDlgs.DlgsForm.ShowPrinter()
>>>>
>>>>HTH,
>>>>
>>>>George
>>>I did what you said and could not get it to work. Maybe you left out a step.
>>>
>>>1. I made my FORM call dlgsform with the buttons you said.
>>>2. Save AS class called "Cmmmdlgs
>>>3. put oDlgs = CREATEOBJECT("cmmndlgs") into my main.prg and added PUBLIC oDlgs
>>>4. put oDlgs .dlgsform.flags=64 - I get an error when compiling that says UNKNOW MEMBER dlgsform.
>>>5. in the click event of a comand buton, I coded oDlgs.Dlgsform.showprinter()
>>>Do you know what is wrong?
>>>
>>>Thanks rob
>>
>>Oops (and I don't mean Object Oriented Programming, either). I left one thing out. Assume the name of the control is CmnDlgCtrl, then the syntax will read:
>>
>>oDlgs.dlgsform.CmnDlgCtrl.Flags = 64
>>
>>and
>>
>>oDlgs.dlgsform.CmnDlgCtrl.ShowPrinter()
>>
>>Sorry,
>>
>>George
>
>Hi George - I can not make it work.
>where do I put..
>oDlgs = CREATEOBJECT("cmmndlgs") and
>oDlgs.dlgsform.CmnDlgCtrl.Flags = 64
>thanks ... :)

Robert,

You're gonna have to forgive me today. I'm having a bad, bad Monday. First, one thing I forgot is to make the form modal. Second, the reference to the form isn't necessary, that's actually the variable. so...

oDlgs = CREATEOBJECT("cmmndlgs") and
oDlgs.CmnDlgCtrl.Flags = 64
oDlgs.CmnDlgCtrl.ShowPrinter()

and finally,

oDlgs.Destroy()

Take pity ;-)

George
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform