>>Hi,
>>
>>I am working on a program that consists of a grid. That is it, the program is just one grid. In this grid the user will see all work orders assigned to him/her. One of the columns of the grid will allow the user to print any of the work orders in the grid.
>>But sometimes, a user does not want to print but simply a view the order; in a report preview format. And the key is that I don't want to have two button - that is to take two columns - one for print, one for preview. In my initial test, I do the preview by using the doPDF driver installed on my PC. So, by choosing this driver, I can view without printing. But I do not want to "force" the customer to install a doPDF or some other driver that allows to convert a print to a PDF.
>>Instead I want all the functionality be in the program.
>>
>>I can add a small menu, when user clicks on this button that will ask if user want to Print or Preview.
>>
>>So, my question, how else would you suggest having both Print and/or Preview in one button of the grid?
>>
>>TIA
>
>I previous application of mine I had similar issue. What I did was had the print button Print when clicked, but Previewed when the CTRL key was pressed when the Print button was clicked.
>
>
>PROCEDURE ShiftState
> DECLARE INTEGER GetKeyState IN user32 INTEGER nVirtKey
> LOCAL nBit AS INTEGER
> nBit = 0
> nBit = IIF(BITTEST(GetKeyState( 0x10 ),8),BITSET(nBit,0),nBit)
> nBit = IIF(BITTEST(GetKeyState( 0x11 ),8),BITSET(nBit,1),nBit)
> nBit = IIF(BITTEST(GetKeyState( 0x12 ),8),BITSET(nBit,2),nBit)
> RETURN nBit
>ENDPROC
>
>PROCEDURE button.Click
> IF BITTEST( ShiftState(), 1)
> * Preview
> ELSE
> * Print
> ENDIF
>ENDPROC
>
Thank you. I will consider this approach.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham