Solved

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

Posted on 2008-06-19
1
1,072 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
ID: 21827579
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 our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
get combo value in class 5 14
Very Large data in MYSQL 7 73
Visual Studio npm 1 12
IDE for Python 5 25
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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

830 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