Solved

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

Posted on 2008-06-19
1
1,085 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 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