473,387 Members | 1,553 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,387 software developers and data experts.

Form Visibility Issue VB.NET 2003

Hello,

I am having a problem with a windows form when controlling its visibility.
My application has a form that displays a timing function. Normally the
timing form is hidden. An object has a timer that causes some processing to
happen and at certain times it is required to make the timing display
visible. To do this it calls a delegate to request that the form be
displayed. Up until this point the hidden form is being upated by the same
delegate with time information, but it is hidden.

When the show event happens the outline of the form appears and the
application becomes non-responsive to any future requests to hide or display
the form.

This appears like a threading issue, but as I understand it as long as the
timing form is being called from the timer thread through "Invoke", which it
is, it should work. Any suggestions please.

Thank you,
Sid.

Apr 21 '06 #1
2 1649
"Spam Catcher" <sp**********@rogers.com> wrote in message
news:Xn**********************************@127.0.0. 1...
"Sid Price" <si*@nowhere.com> wrote in
news:uC**************@TK2MSFTNGP02.phx.gbl:
When the show event happens the outline of the form appears and the
application becomes non-responsive to any future requests to hide or
display the form.

This appears like a threading issue, but as I understand it as long as
the timing form is being called from the timer thread through
"Invoke", which it is, it should work. Any suggestions please.


You might want to try BeginInvoke instead.

So althought invoke is correct - if the invoked function takes a long time
to run, it'll still block the UI.

Also any sub calls? They should all be checked for InvokeRequired as well.

Oh lastly - were all objects created on same thread? If not - you'll need
to check Object.InvokeRequired on each object - so that the call is
marhsalled to the right thread.


Many thanks for your note (whoever you are :o)) I implemented the
"InvokeRequired" check and followed it with the "BeginInvoke" and this seems
to have resolved the problem.

Again, many thanks,.
Sid.
Apr 22 '06 #2
I have a little more information on this issue if anyone has any ideas I
would much appreciate hearing them:

The problem occurs under the following two conditions.

1. The dipslay form is hidden and needs to be shown, AND
2. The call to show the display form is NOT in the thread that
instantiated the form.

Note that the following code is used to figure out if the call needs to use
BeginInvoke or not:

If mDisplayWindow.InvokeRequired = True Then

mDisplayWindow.BeginInvoke(New DVisible(AddressOf Delegate_Visible), New
Object() {DisplayVisible})

Else

mDisplayWindow.Visible = DisplayVisible

End If

I have checked that when the request to show the form comes from the thread
BeginInvoke is being called regardless of the form being currently visible
or not.

Thank you,

Sid.

"Spam Catcher" <sp**********@rogers.com> wrote in message
news:Xn**********************************@127.0.0. 1...
"Sid Price" <si*@nowhere.com> wrote in
news:uC**************@TK2MSFTNGP02.phx.gbl:
When the show event happens the outline of the form appears and the
application becomes non-responsive to any future requests to hide or
display the form.

This appears like a threading issue, but as I understand it as long as
the timing form is being called from the timer thread through
"Invoke", which it is, it should work. Any suggestions please.


You might want to try BeginInvoke instead.

So althought invoke is correct - if the invoked function takes a long time
to run, it'll still block the UI.

Also any sub calls? They should all be checked for InvokeRequired as well.

Oh lastly - were all objects created on same thread? If not - you'll need
to check Object.InvokeRequired on each object - so that the call is
marhsalled to the right thread.

Apr 24 '06 #3

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

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
3
by: Jukka K. Korpela | last post by:
I have noticed that the meaning of visibility: collapse has been discussed on different forums, but with no consensus on what it really means. Besides, implementations differ. The specification...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
3
by: veganeater | last post by:
Hi, I'm wondering if there's a way that I can select which <div> to show based on the user's selection from a dropdown/listbox form. <form name="form1" method="post" action=""> <select...
4
by: jerryyang_la1 | last post by:
I've found this script that allows be to hide/show form elements.. <script language="JavaScript"><!-- var toggle = true; function show(object) { if (document.layers && document.layers)...
1
by: iMedia User | last post by:
I have a site where I want to use the Web form validators in two separate forms on a single page. One form allows existing users to log in while the second one allows new users to register. The...
17
by: Jim Little | last post by:
Hello, I'm driving myself crazy either because I'm missing something about ASP.NET, or what I'm trying to do simply can't be done. First, I am not using session variables to track state. My...
8
by: jd2007 | last post by:
Why the Ajax code below in ajax.js is causing my form not to work ? ajax.js: var a=0; var b=0; var c=0; var d=0; var e=0; var f=0;
3
by: msg2ajay | last post by:
hi, I am not able to align the textfield to the top of the frame one bye one. The problem is it is showing where it is hiding..... so is it possible to allign the text field to the top of...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.