473,809 Members | 2,699 Online
Bytes | Software Development & Data Engineering Community
+ 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 1502
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
2738
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 doing the following steps: 1. add a web setup project called "testaddr". 2. in file system window, select Web Application folder. 3. in the left pane of the file system window, right-click web application, point to add, and then click output...
6
15648
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 suggested simply queueing two click events, but this is not working for me, regardless of the delay I put between clicks. So give this as a click (where INPUT is an appropriate structure for sending the SendInput data): public static void Click()
1
2656
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 System.EventHandler(this.comboItems_DoubleClick); .... private void comboItems_DoubleClick(object sender, System.EventArgs e) {
4
3858
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
5243
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 appear to be the result of double-clicking the submit button on the form. The form has three ASP:Button tags, each of which gets translated into INPUT TYPE="SUBMIT" HTML elements. One submits the form's data. One logs the user out. And the other...
3
2961
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 list. The user must then click a button to select that customer and move off the page to the main database details. I would like to implement being able to double-click the listview item and it have the same effect as single clicking and then...
1
3476
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 doing the following steps: 1. add a web setup project called "testaddr". 2. in file system window, select Web Application folder. 3. in the left pane of the file system window, right-click web application, point to add, and then click output...
1
5428
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 will also initiate the single click action. Has anyone figured out a way to circumvent this problem? Right now I am making the Double click function undo the action my Single click function does, but this is very annoying, especially since the...
3
3616
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. I would like them to be able to double Click a record in this datasheet and have it open a subform, populated from a Query that is passed the SSN from the recordset that was clicked. I have included the following code in the vba: Private Sub...
0
1071
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 application will pop-up. Please help
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10387
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7662
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.