473,666 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom Form acts like drop down won't click.

122 New Member
I have a custom form that launches from a button. The form works great with a little hick-up.

When you open the form the onmousedown does a check to see if the click from the mouse is on the form or outside the form or if the click is on the close section of the form.

This part works fine except when i click on the form i have to click once to say i am on the form then a second time to access any controls, I want to transfer the click after the check to any underlying controls.

here is the code any help would be greatly appreciated.

Expand|Select|Wrap|Line Numbers
  1. //Check to see if the close button is pressed on the drop-down form to allow the user to close it early.
  2.                 if (_llClose.RectangleToScreen(_llClose.ClientRectangle).Contains(Cursor.Position))
  3.                 {
  4.                     Close(); //close the drop-down
  5.                 }
  6.                 else
  7.                 {
  8.                     //Check to see if the click is inside the drop-down Form
  9.                     if (RectangleToScreen(ClientRectangle).Contains(Cursor.Position))
  10.                     {
  11.                         rectangleChecked = true;
  12.                         OnMouseDown(e); //normal mouse behavior  
  13.                         FrmAddressEntry_MouseClick(this, e);
  14.                     }
  15.                     else
  16.                     {
  17.                         Close();
  18.                     }
  19.                 }
  20.  
  21.  
I have tried a few things so any of you with more knowledge and a few minutes I would sure appreciate your help.
Mar 22 '10 #1
2 1948
DragonLord
122 New Member
What I am basically trying to accomplish is one click either focuses on the window or closes it. but the same click will transfer through and activate the drop down or focus on the text box etc. if it is inside the rectangle.
Mar 23 '10 #2
DragonLord
122 New Member
anybody have any ideas?
Apr 2 '10 #3

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

Similar topics

14
3097
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ; ExpenseType Data: 1 ; FOOD 2 ; AIRLINE 3 ; FARE
4
1922
by: jesse.hartwick | last post by:
Hey group! I have a toolbar with a "DEVELOPER" menu. I have it so that it when the menu title is clicked, a pop-up form will appear if the user has not yet verified that he or she has developer privileges (this menu only appears when the user is set up as a developer, but i'm a bit paranoid on these matters i guess). My problem is that when the menu title is clicked, the form appears but so does the menu, and the menu has the focus,...
7
3338
by: Girish | last post by:
OK.. phew. Playing with data grids for the past few days has been fun and a huge learning experience.. My problem. I have a requirement to display a gird with a gird. Within the embedded grid, theres a requirement to show a drop down menu list (this is a control I downloaded online) in one of the columns. For the purposes of this question, Ive implemented the drop down menu as a drop down list instead. Ive got all this working at this...
5
2148
by: ross kerr | last post by:
Hi All, I am extending the combobox to create a control that selects an item based on the text the user is typing into the text area of the control. I have an issue that occurs only when i drop down the combo box as the users typing. When the on leave event is fired the value in the selected
8
271
by: rodchar | last post by:
hey all, i was wondering if this was worth doing or what implications might be. if i had a form that has 6 or more table lookups inside drop down lists would 6 custom controls be a lot of overhead. ( i mean these drop down lists are used a lot in different places which i think would warrant custom control drop down lists). and the table lookups are to basically 1 or 2 tables. would that mean 6 different connections would be open? just...
5
3923
by: ortaias | last post by:
I have a form which calls up a second form for purposes of data entry. When closing the data entry form and returning to the main form, things don't work as expected. When I return to the main form, I trigger the on acitvate event to run a macro. I can use the Dlookup function to update my fields, which is OK. However, I intitially tried to use the Repaint Object command to repaint the form. That did not work. Though I solved the...
19
4907
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the exception of custom Collection Classes. Background: I'm developing an A2K .mdb to be deployed as an .mde at my current job-site. It has several custom controls which utilize custom classes to wrap built-in controls, and add additional functionality....
15
6506
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt accept other controls. The control i drag drop on it becomes the child of my custom control's parent form and not the child of my custom control. Then i added this line "" before my custom control class (i dont know what this line does). Now
4
18881
by: =?Utf-8?B?UmljaGFyZCBCeXNvdXRo?= | last post by:
Hi I'm trying to create a composite control to be used on a ToolStrip, consisting of a ToolStripComboBox and a ToolStripButton. It's going to be a control used to search for text in a grid control on a WinForm. I've got it working fine on a single form but now want to reuse this functionality on other forms. Usually this would be a simple matter of creating a UserControl, however a ToolStripComboBox cannot be placed on a UserControl.
2
294
by: DaveL | last post by:
Hello, I have a Custome Control which contains TextBox Button DataGridView design is Textbox , button When a user clicks the button i resize the custom control canvasarea to expose the datagridview below the textbox
0
8448
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
8783
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8552
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
8640
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...
0
7387
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5666
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
4198
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...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1776
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.