Click here to Skip to main content
15,894,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have generate report in excel and pdf
so i used 2 btn

excel and pdf

on click excel btn reports generate in excel
and on click pdf btn report generated in pdf

in some case on click btn excel or btn pdf report generated but takes some more time in that time if user click twice btn excel or twice btn pdf application hangs

so what i want is

on click btn excel or btn pdf both btn disable till report generated in excel or in pdf after report generated then both btn enable .
Posted
Comments
m@dhu 27-Apr-12 2:09am    
I would like to use a progress bar instead of disabling and enabling the buttons.

for Enable/Disable purpose of button you can use : btn.Enabled property as -

btn.Enabled = false (For disabling button control)

btn.Enabled = true(For Enabling button control)
 
Share this answer
 
OnClick on both Button events just set the visibility to false..

as

excelBtn.Visible=false;
pdfBtn.Visible=false;

Use these two lines in both of your button click events.
 
Share this answer
 
put
onlick excel method
excelbtn.visible=false
onclick pdf method
pdfbtn.visible=false
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900