Click here to Skip to main content
15,797,721 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 .
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..



Use these two lines in both of your button click events.
Share this answer
onlick excel method
onclick pdf method
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