473,382 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Disappearing buttons

Hi,
I have a form where i have a thread working in the background that
tests a connection to a server. If the connection is not
successful,then I want it to display 2 buttons on the form. I have
tried doing this so far by simply setting the buttons Visible property
to true (since they will initially be invisible), but by doing so, the
buttons don't seem to appear. I have also tried using the Show()
method, which makes the buttons appear, but then the buttons do not
seem to function properly i.e. clicking on the buttons do not do
anything. Using the Focus() method following the Show() method doesn't
seem to work either.
If I don't use a thread to test the connection then evrything works
fine. But I need to use a thread so that the GUI can function whilst
the connection is being tested
If any1 has any ideas it would b greatly appreciated

Regards,
Tim

Nov 16 '05 #1
2 1504
Use the control's Invoke method to set the property from the other thread.
Controls are not thread safe so they can't be accessed from any thread.
That's what the Invoke() function is for.

I don't know why they would be disappearing, but that's the first thing I'd
try.
--
Klaus H. Probst, MVP
http://www.simulplex.net/
<ti*******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,
I have a form where i have a thread working in the background that
tests a connection to a server. If the connection is not
successful,then I want it to display 2 buttons on the form. I have
tried doing this so far by simply setting the buttons Visible property
to true (since they will initially be invisible), but by doing so, the
buttons don't seem to appear. I have also tried using the Show()
method, which makes the buttons appear, but then the buttons do not
seem to function properly i.e. clicking on the buttons do not do
anything. Using the Focus() method following the Show() method doesn't
seem to work either.
If I don't use a thread to test the connection then evrything works
fine. But I need to use a thread so that the GUI can function whilst
the connection is being tested
If any1 has any ideas it would b greatly appreciated

Regards,
Tim

Nov 16 '05 #2
Thanks Klaus!
it all works fine now

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Larry Woods | last post by:
I have a site that works fine for days, then suddenly, I start getting ASP 0115 errors with an indication that session variables IN SEPARATE SESSIONS have disappeared! First, for background...
1
by: Phil N | last post by:
Hi all. I've been here before and got a lot of help with my neophyte troubles so I'm back again. This time I have a number of questions (if I can remember them all). (I've pasted the code...
3
by: Csaba2000 | last post by:
I apologize for the length of the page below, but I've tried to whittle it down as much as I can. The problem is that Netscape 6.1 on my Win 2K Pro machine is disappearing the final row of the...
2
by: AJ | last post by:
Hi all, I'm brand new at using Visual Studio, but I have basic programming knowledge from C++. I created a Windows form with some buttons, a tab area and tabs, and some combo boxes with a list...
2
by: Miguelito Bain | last post by:
Hi Everyone- I have a problem with my menu bars disappearing. Here's a little backround... I have one main database that has a page called "Prior Records." There are several command buttons...
2
by: Bernie | last post by:
We have an application with several forms whose command buttons appear just fine the first time the form is opened. The next time it is opened the button disappears. If you click where the button...
1
by: NWdotnet | last post by:
Haven't been able to get to the root this odd problem. Perhaps someone here can suggest something that will get me on the right trail? Its probably the same issue Alex reported in 2003 but had no...
6
by: altrove | last post by:
In a MsAccess 2002 mdb (when used in 2003 and 2007 too) 2 command buttons of 1 form (with 4 buttons in total) dissapear when I open a second form and then I come back to it. Anybody can give...
0
by: Earl Anderson | last post by:
In A2003, we have a multi-tabbed form. One of the tabbed forms is a data entry form with a subform containing a memo field, some dropdowns and some 'action buttons' (i.e Add New; Edit, etc.). On...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.