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#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in VISUAL-STUDIO-2008
- Automatically Compile .Net UserControls
- Error code 31 returned from mt.exe when building C++ projects in Visual Studio 2013
- Issue with Referenced DLL's on compiled EXE in Visual Studio 2008
- How can I prevent picture boxes from intersecting, while they are in constant movement?
- Microsoft TFS and Visual Studio 2008 - project hierarchy changing on server
- Disable clock edit on windows 6.5
- How to static link EDK II library into application in Visual Studio 2008 tool chain
- MFC Feature Pack 2008 CPaneDialog as CDialogBar
- Can we highlight single word of from Text Property (have multiple words)of Label Control
- Getting exception while compiling in 64bit visual studio 9.0 sp1
- Error LNK2019 LNK2001
- Desktop Shortcut Icon is different than Application Icon
- Trying to reduce size of memory allocations in debug compilations for C++
- c++ wofstream issue in unicode program
- How to set parameters as optional while adding crystal reports in central management consol
Related Questions in COMBOBOX
- WPF - How to highlight a combobox border when focused
- How can I exclude .xlsb file types in my ComboBox?
- ComboBox Not Being Filled With Unique Field Values Via Dictionary Learning
- DataTrigger is not working
- Access query/combo box
- Combobox and IDataErrorInfo
- Compare date from combobox with current date
- Combo Box 1st item is remained empty in WPF c#
- How do you populate a Combobox based on the selection of another Combobox?
- Cant bind enum to combobox wpf mvvm
- How to dynamically create Sharepoint ComboBoxes?
- Extjs getComponent from another view
- How to save value in ComboBox after refreshing the Rally Dashboard
- Retrieve data from Db set by combobox and display to textbox
- Using multiple JComboBoxes; but they all get any action events
Related Questions in TOUCHSCREEN
- Android touch screen power consumption
- Recording the time of the start of a screen touch in PsychoPy on Windows
- Using GetSystemMetrics how to determine if a screen is touchscreen
- Mousedown or touchstart called?
- input_report_abs axis offset
- Touch Screen event for tiny2451->S3c2451 ARM9 core
- WEC7 project (Platform Builder): touch screen display drivers issue
- How to determine if a device is touchscreen in Lotus Script in Registry
- mousemove based scrolling script need to adapt for touchscreen use
- Adb shell from application
- Disable Chrome paste menu on text inputs while on a touch screen
- Can I install my custom APK in Android Box?
- Chromium how to convert drag and or hold to click?
- Raspberry Pi: PiTFT-display touch stops working after some touches
- Need a Gui Keypad for a touchscreen that outputs a pin when code is correct
Related Questions in NUMERICUPDOWN
- How to make each listbox item have its own value via other controls such as numericUpDown and checkbox?
- C# form numeric up down
- MahApps NumericUpDown make up down buttons bigger
- Use NumericUpDown to select days in month
- NumericUpDown Invalid value
- Create array of NumericUpDowns and disable all of them?
- Using mouse to increment and decrement value of the NumericUpDown control in VB.net
- MouseMove Event Missing from properties list for a NumericUpDown control
- ComboBox show dropdown menu on text selection
- NumericUpDown UpdateEditText causing problems when entering values
- Change the increase value of numericupdown
- adding a sign to numericUpDown value (like %)
- How can I calculate textbox values' total with NumericUpDown?
- Ajax NumericUpDownExtender error
- Adding Rows in DataGridView based on numericupdown
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