Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
on printInvoice
set the visible of button "btnPrint" to "false"
put specialFolderPath("documents") & "/Invoice013.pdf" into tPDFPath
-- Handle the default text of the myCompany field
if the text of field "myCompany" is "Your company" then
set the visible of field "myCompany" to false
else
set the visible of field "myCompany" to true
end if
open printing to pdf tPDFPath
if the result is "Cancel" then
exit printInvoice
else
--print card "invoice" of this stack from 0,0 to 575,600 into 0,0,575,800
print card "invoice" of this stack into 0,0,575,800
end if
close printing
set the visible of button "btnPrint" to "true"
end printInvoice
Is it possible that button "btnPrint" is on a card other than the active card? If so adding "of cd CardNumber" could be the answer. I see nothing wrong with the code posted here , so it has to be something happening out of the scope of what you posted.
Not sure if this matters, but true and false are normally used without the quotes ...
Michel J.L. van der Kleij Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl
on mouseUp
set the visible of button "Button" to false
end mouseUp
When I clicked the button in Run mode, the button didn't disappear. However, I did notice that the visible flag in the button properties is being unset. I wonder if there is some sort of bug with this.
Or maybe I'm just doing it wrong.
I never had any problem setting the visibility of any object in LC in the last 15 years!
So I presume, there is something else going on, but have no idea what!?
on mouseUp
set the visible of button "Button" to false
end mouseUp
When I clicked the button in Run mode, the button didn't disappear. However, I did notice that the visible flag in the button properties is being unset. I wonder if there is some sort of bug with this.
Or maybe I'm just doing it wrong.
Does it disappear when you print to the printer? I am curious if this may be a bug when printing to pdf. One other question though. Do you have "Show invisible objects" checked?
Can you send me the (stripped down) stack, so I can take a look?
Will be much more effective that guessing around here for a couple of hours
Send it to: klaus AT major-k.de
Is the stack in LC 7 format?
Does this happen on a Mac or WIndwos?
Thank you for your help and replies. Based on a chat with Klaus, and the other replies, I decided to take a look at my installation.
It appears as though an old installation, possibly 6.x or 7.0 (RC2) was having an influence on my install. Removing all older versions of LiveCode resulted in the button disappearing as expected.