473,831 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Determine if the Combo Box button has been clicked in a DataGridViewCel l

JB
Hi Everyone,

I have a DataGridView with Combo Boxes in its cells.
I'd like to know if the user has clicked on the right side arrow
button that triggers the opening of the drop down list.
After experimenting with the various events, I can find out which cell
the user has clicked and whether or not he/she's clicked in the
content (i.e. on the content text), but not on the right side arrow
button.
Can somebody help me out with this?

Thanks
JB
Jun 27 '08 #1
1 1685
You MIGHT be able to do some mathematical operations to determine
this.

When you click you do a hittest to find out where the mouse is on the
control. After knowing where the mouse is on the form you just have
to determine where the mouse is within the cell which can be used by
calculating the rowheight of every row to that point and the column
width of every column to that point. Once you have that information
you'll know that the button is [buttonwidth]px out of a total
[columnwidth]. If the hittest returns a value columnwidth -
buttonwidth they're clicking the button.
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3303
by: webstar | last post by:
Hi, I know how to do an action listener with a button but now I want to try something a bit harder. This is what I want to do... When you user presses the JButton it looks at the JComboBox to see if it is selected. If it is, a sound is played. If it isn't, nothing happens. I'm not sure how to do this so if someone could give me a simple example or send me on the write track I would very much appreciate it. Thanks alot
8
2442
by: PeteCresswell | last post by:
I'm looking for some code that makes a list presented in a subform autoscroll in response to the user typing - like a combo box dropdown or a regular ListBox does. I.e. The user is looking at subform that is a list of, say, 2,000 people's names. The first name is "Aardvark, John", and the last name is "Zero, James". Instead of scrolling, the user types "S" and is jumped to "Sammons". Then, on the next keystroke as they type "m", it...
2
2539
by: Vern | last post by:
I have a custom control which has it's own OnValidating event handler. I would like to skip the validations if the Cancel/Exit button is pressed. Also, if possible, would like to skip the validations if the X was clicked to close the form. How can I do this? Thanks, Vern
4
2291
by: Shyguy | last post by:
I have a combo box that searches for records in the database. When a name is typed in that is not in the database, Access shows a message box that says, The test you entered isn't an item in the list. with an "OK" button. Is there a way to get it to clear the text that has been typed in, or highlight it when the "OK" button is clicked?
7
3344
by: Arnold | last post by:
Greetings Gurus, In a mainform's header, I have a combobox named comboStudents. The rowsource for this combobox is: SELECT -999 As StudentID, "<Add New Student>" As FullName, "aaa" As LastName, "x" As FirstName From qryStudents UNION SELECT StudentID, FullName, LastName, FirstName FROM qryStudents ORDER BY LastName;
2
7755
by: =?Utf-8?B?UmljaA==?= | last post by:
I have code to bold text in a datagridviewcell: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim cs As DataGridViewCellStyle, fnt As Font For Each c As DataGridViewCell In dgrv1.SelectedCells cs = c.Style Console.WriteLine(c.Style.Font) fnt = dgrv1.Font Console.WriteLine(fnt.Name)
6
5037
by: banderson | last post by:
Hello, I have a form and a combo box that I use to filter the form to particular records. I also have an "add new" button that, when clicked, adds a new record. My problem is that the filter combo box stays on the old selection when the new record pops up. I would like to have the combo box clear or set to a default value of "New" when the Add New button is clicked or when the user clicks on the * (new record) button in the navigation bar. ...
1
9719
by: Alex | last post by:
Hi, I need an event to fire off when someone clicks anyplace within a DataGridView row, but whether I use CellContentClick or CellClick, the event only fires off when clicking on the text within the row and not anyplace within the row. Is there someway for the event to fire off regardless of where they click in the row? Here's a snippet: Private Sub dgvStuff_CellContentClick(ByVal sender As
23
19144
by: shashi shekhar singh | last post by:
Dear sir, I have a word document file contains text and images, now i have saved it as a web page and wants to display it on browser , using , string str=directory.getfiles(""); response.contentType="text/html"; response .writefile(""); it displayed in different format and images not shown blank spaces shown as ?????????? and image as X.
0
10777
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10493
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
10526
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
10206
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
9315
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...
1
7747
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
5780
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4416
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 we have to send another system
2
3960
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.