Controls whether the webpage Panel is displayed and the webpage panel
There are 12 Panel controls on the webpage. The default status is not displayed. The Panel controls the display based on the current month.
The following three methods are used to implement Insus. NET. First, the first method is to use the FindControl method.
The second method is to use the foreach method to find all Panel controls in the form and set the Visible value to true:
Third, because the month has 12 months. Therefore, use for 12 cycles:
The running result is as follows:
The display of the panel control does not work.
I think of a possibility. Maybe you put the panel in another panel.
C # How does a thread control normal display and hiding of a panel?
There is a java CountDownLatch class design to deal with this problem.
. Network does not seem to have such a class, you find it. Net CountDownLatch, and then there will be some code to simulate this class.
The principle is to define a CountDownLatch counter at the beginning. For example, if you have two subthreads and the counter is 2, when each subthread completes the execution, when the counter is between 1 and 0, the two sub-threads outside need to wait for the () method to stop the counter. In this way, when the counter reaches zero, the main thread can continue to execute it.
I am writing java code. You can refer to the example of simulating CountDownLatch on the Internet.
The final CountDownLatch lock = the new CountDownLatch (1 );
// Verify that the file server is running correctly
New topic (New Runnable ()
{
Public invalid run () method
{
StartCheck (locked );
}
}). Start Online ();
Lock. await (); wait
// Continue with the main thread
StartCheck method. If the execution is complete, you only need to call lock. countDown ;.