PC Review


Reply
Thread Tools Rate Thread

Disappearing buttons

 
 
timm.wong@gmail.com
Guest
Posts: n/a
 
      6th Jan 2005
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

 
Reply With Quote
 
 
 
 
Klaus H. Probst
Guest
Posts: n/a
 
      6th Jan 2005
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/


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
timm.wong@gmail.com
Guest
Posts: n/a
 
      6th Jan 2005
Thanks Klaus!
it all works fine now

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Buttons disappearing from QAT Angie M. Microsoft Word Document Management 0 22nd Dec 2009 06:38 PM
Disappearing Buttons PseudoBill Microsoft Dot NET Framework 3 19th Dec 2004 07:34 AM
Disappearing buttons No One Microsoft ASP .NET 4 15th Oct 2004 01:03 AM
xp pro disappearing buttons steve Windows XP General 0 23rd Feb 2004 09:47 PM
Buttons Disappearing in GUI Jeffrey Parker Windows XP General 0 12th Nov 2003 05:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:17 AM.