473,383 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Determine if the Combo Box button has been clicked in a DataGridViewCell

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 1649
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
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...
8
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...
2
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...
4
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...
7
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...
2
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...
6
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...
1
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...
23
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("");...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.