473,508 Members | 2,343 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 1942
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
3082
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 ;...
4
1912
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...
7
3326
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,...
5
2133
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...
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...
5
3918
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...
19
4891
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...
15
6474
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...
4
18863
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...
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...
0
7225
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
7123
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
7382
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
7042
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
7495
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...
1
5052
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...
0
3193
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
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.