Solved

button1.PerformClick() not working when a different tab is in focus

Posted on 2008-06-19
1
1,054 Views
Last Modified: 2013-12-16
Hi Guys,

Here's my problem.

1. I have a tabcontrol with 3 tabpages.
2. I also have a timer. Now when this timer reaches zero it is supposed to do a button1.PerformClick()
3. Everything works fine when i am viewing tabpage1 as the timer reaches zero, performs the click and works fine.
4. When I am viewing tabpage2 or tabpage3 whilst the timer reaches 0, it does not do the button1.performclick()

I am using VS 2008 C#

What Am i missing here. ... probably something simple (hopefully) . Any help would be much appreciated.

Regards,

Marek
0
Comment
Question by:chudmarek
1 Comment
 
LVL 9

Accepted Solution

by:
djon2003 earned 400 total points
Comment Utility
Do you require the button to be clicked or only the code when clicked to be run ? If it's the second one I would suggest to extract the code from the button to create another sub accessible from both place (button & timer).

Then call the new subroutine from you button click event & from your timer event
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now