I want to show the list of items in a combo box when the user selects the text. I have a touch screen application and it's very difficult to hit the dropdown arrow so I figure I'd show the menu when the text is selected which is often what gets touched. I'm using VS 2008. and suggestions for a touch friendly numeric up down solution in VS2008?
ComboBox show dropdown menu on text selection
4.6k views Asked by fifamaniac04 At
2
There are 2 answers
0
teynon
On
I was working on a similar situation. We wanted to make the text area behave the same as the button on the right. (IE the user clicks and gets the drop down box)
davidsbro is similar to what I ended up doing, but we wanted it to close if they clicked again, so the value became dropDown.DroppedDown = !dropDown.DroppedDown;.
The issue with this is that if the user clicks the right button of the drop down box, the dialog box opens, then calls the onClick event.
I solved this situation by tracking the original state via the onmouseover event. If the value has changed, we have to assume that the button on the select box handled the click already.
private bool cbDropDownState = false;
private void dropDown_MouseEnter(object sender, EventArgs e)
{
cbDropDownState = dropDown.DroppedDown;
}
private void dropDown_Click(object sender, EventArgs e)
{
if (dropDown.DroppedDown == cbDropDownState )
dropDown.DroppedDown = !dropDown.DroppedDown;
}
Related Questions in C#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in VISUAL-STUDIO-2008
- Unable to cross-compile a simple program using MSVC 9
- How to add/import and control 3d object to visual studio 2008
- How to use charting libraries in windows form application for compact windows?
- How to use MSBuild for Visual Studio 2008 in a docker container?
- Cannot edit and save DLL resources in Visual Studio
- Special language constants make the .RC file uneditable
- visual studio How do I run a windows 2008 ce Solution on VS 2017?
- [VB.NET][2008] 2 forms show and close
- What is the meaning of #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_BGR)
- Visual Studio 2008 DataGrid column width changing
- How to run batch script in IBM Rhapsody after build is successful to copy config files
- How to add reference under COM link in Visual Studio 2008?
- Visual Studio 2008 Form1 textbox1.text renames Form2 label1.Text
- How can I tell what version of VB/.NET this project is using?
- How Objects stored in memory? Inherting a Base Class vs. Creating a Base Class Member Object
Related Questions in COMBOBOX
- How can I get this ComboBox to bind, populate the dropdown and write back selected value on update?
- Combo box in NextJS
- Combobox "ArgumentOutOfRangeException" at "ComboBox.ObjectCollection.cs"
- How to manually add a value to data source with combo box in Power Apps
- Blazor two-way data binding with InputSelect never enters VM property set
- wpf combobox how to handle PreviewMouseWheel
- How to reset a group of comboboxes back to no selection tkinter?
- Disable either the Togglebutton or Popup Dropdown of a Combobox via property binding
- In Excel I need to use userform combobox to lookup number from table, then use that number to replace a number in another table
- String Type Value Member and Display Member in VB.NET Combobox with manually filled data
- SfComboBox Selection Box Blank After Selection Until Clear Button Pressed
- Excel VBA UserForm ComboBox not displaying named range list
- Power apps Groupby Function Combobox Selected Value
- How do I fix my Problem with ComboBoxes in Java Swing?
- .NET MAUI Custom ComboBox
Related Questions in TOUCHSCREEN
- Two touchscreen same product and vendor ids, needs to invert one
- Why are left and top properties disabled when using TouchMove-event
- How do I prevent when I touch screen, scrolling stops in Flutter
- Goodix GT911 touchscreen controller starts generating i2c signals 64 seconds after device power-on
- KinematicBody2D direction/rotation towards finger touch in Godot 3
- Accessing raw conductivity data from capacitive touchscreen on Android/iOS
- How to read touchscreen input from assembly on Surface with no OS (not under Windows)
- Moving UP and DOWN on 360° video with a SAMSUNG FLIP 4 touchscreen
- SDL touchscreen areas remain focused when motion events are triggered on them
- How to update touch points for S2240T touchscreen monitor on Raspberry PI 4
- Kivy with touchscreen call twice the function but not with mouse
- How can I access raw touch capacitive images from an Android phone?
- Problem with clickable image on touchscreens (phones)
- Screen rotation when launching PyQt5 application on linux without X server
- incorrect coordinates with event.touches[1].clientX in javascript
Related Questions in NUMERICUPDOWN
- Cancel Key before it is shown in NumericUpDown
- Value returned after numericUpDown1 value exceeds the maximum range (C# Windows Form)
- Conversion from Lat Long to MGRS is working but not the other way around C#
- Can I set dataGridView rows based on the value in numericUpDown
- Display the default value in the newly added row (DataGridView)
- How do I style an Avalonia NumericUpDown control integer-only?
- numericUpDown used with return values
- How to Increase or Decrease decimal places in datagridview cells using a NumericUpDown control?
- NumericUpDown with different increment values
- How to search for matches from an array of pairs for a certain number of rows in a ListBox?
- C# Assigning numericUpDown value to a specific cell in Excel file
- How to give padding(all sides) to a value inside NumericUpDown Control in Winforms
- Custom DataGridView NumericUpDown editing control
- C# Windows Forms Application: Change behavior of all instances of a control
- Winform numericUpDown have different delay for up and down value change
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
You could use the
ComboBox.Clickevent handler and the ComboBox.DroppedDown property and do something like this:You could also use the same event handler for a numericUpDown and use the mouseposition as well as the position and height of the NumericUpDown to get whether or not the click was above or below the halfway-line of the control by doing something like this (not sure if my math here is perfect, but it worked when I tested it):
HTH