473,466 Members | 4,869 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Why does the application work only on double click?

103 New Member
I have a method that works, but when I click a link the first time the new form opens as it should. I then have in the method to check to see if the new form is open by using a bool variable. This works properly, but requires that I click the button twice before it will perform. What is causing this? Any Ideas or Suggestions? I have attached my code below for the Method.
Expand|Select|Wrap|Line Numbers
  1. private void lblClose_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  2.         {
  3.             Form intiatedForm = null; /* creates an instance to a new form.  Used to open another form when called.*/
  4.             if (openForm == false)
  5.             {
  6.                 intiatedForm = new frmClose();
  7.                 intiatedForm.Show();
  8.                 openForm = true;
  9.             }
  10.             else if (openForm == true)
  11.             {
  12.                 FormCollection _forms = Application.OpenForms;
  13.                 foreach (Form a in _forms)
  14.                 {
  15.                     if (a is frmClose)
  16.                     { openForm = true; }
  17.                     else openForm = false;
  18.                 }                
  19.             } 
  20.         }
Oct 18 '11 #1
1 1487
Brian Connelly
103 New Member
Hello dear readers, I found the answer. What was happening is that on thedouble clicking was that the first click my code was setting the bollean to false and doing nothing. Then because the the boolean variable was set to false, the second click executed the code for the false bool.
Oct 19 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Wendy Elizabeth | last post by:
Can you give me some suggestions of why the xml web service is not working? I have an xml web service that works in my visual studio. net 1.1 environment. I setup this project up for deployment...
6
by: Richard A. Lowe | last post by:
I'm using P/Invoke to call SendInput (using code culled from these newsgroups!) to send mouse events to a window. But I'm unsure how to send double-clicks. A VB6 article I saw on SendInput...
1
by: Alex K. | last post by:
I am using combo box with DropDownStyle = simple. Tried to use double click event but it does not work. I've got this.comboItems.DoubleClick += new...
4
by: perspolis | last post by:
hi I manage a double click event in a combo box.. but this event doesn't fire ???? I don't know why??
1
by: rmgalante | last post by:
I have written an ASP.Net application that uses the standard client-side and server-side validation for various fields on the form. Some of the customers that use the form report symptoms that...
3
by: Siv | last post by:
Hi, I have a ListView control in a Windows application, currently single clicking a customer name in this list, selects the customer and displays their details in text boxes to the right of the...
1
by: Wendy Elizabeth | last post by:
Can you give me some suggestions of why the xml web service is not working? I have an xml web service that works in my visual studio. net 1.1 environment. I setup this project up for deployment...
1
by: scott_gui | last post by:
Creating a Windows application: <Double-Button-1> mouse event has a conflict when there is also a binding to the <Button-1> event. It seems like a silly oversight that performing a double click...
3
by: thayes5150 | last post by:
I have an Access 2003 database used to research unemployment claims. The main form contains a subform in datasheet view listing the employee claim records, including employee Social security number....
0
by: Salim Zaabi | last post by:
Hi I have been trying and searching for good source to the following: registering a new file extension and associating it with an icon, and when double click on the file with new extension an...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.