473,399 Members | 3,603 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,399 software developers and data experts.

Autoexpand a combo box

jamesd0142
469 256MB
comboboxname = cboln03

Is it possible to click a button and the combo box expand as if a user clicked the arrow?

so click a button - cboln03 opens to reveal list of items.

Thanks
Dec 18 '07 #1
6 2339
Killer42
8,435 Expert 8TB
You could try this (little sample I just wrote and tested - it appears to work)
Expand|Select|Wrap|Line Numbers
  1. Combo1.SetFocus
  2. SendKeys "{F4}"
Dec 19 '07 #2
lotus18
866 512MB
You could try this (little sample I just wrote and tested - it appears to work)
Expand|Select|Wrap|Line Numbers
  1. Combo1.SetFocus
  2. SendKeys "{F4}"
Hi Killer42

Can you explain to us what's the function of using F4? I really have no idea. LOL
Dec 19 '07 #3
Killer42
8,435 Expert 8TB
When the focus is on a combobox, you can press the F4 key (also Alt-Down, I think) to expand the list.
Dec 19 '07 #4
jamesd0142
469 256MB
You could try this (little sample I just wrote and tested - it appears to work)
Expand|Select|Wrap|Line Numbers
  1. Combo1.SetFocus
  2. SendKeys "{F4}"
Thanks thats what i needed!

could you use this sendkeys thingy to capture key press?

say something like:
Expand|Select|Wrap|Line Numbers
  1. if sendkeys.send("{alt+a}") = true then
  2. 'do something
  3. end if
  4.  
Dec 19 '07 #5
Killer42
8,435 Expert 8TB
I'm not familiar with the capabilities of VB.Net (I use the ten-year-old VB6) but as far as I know SendKeys is only for sending, not receiving.
Dec 19 '07 #6
SendKeys does not allow for the processing of keys inputted, however it is possible to detect keyboard actions using keydown/keypress events on different objects. The example below demonstrates how.

Expand|Select|Wrap|Line Numbers
  1. Private Sub textBox1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs)  Handles textBox1.KeyDown
  2.  
  3. If e.KeyCode == 65 Then
  4.   ' Whatever you wish to do, note you can convert the key code to its ASCII char
  5. End If
  6.  
  7. End Sub
I hope this helps you with getting key input. Each character has its own decimal value and I'm not sure but I believe you can use Chr() to convert its decimal value into the ASCII character.

Chris
Dec 19 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
2
by: DBQueen | last post by:
Hi - In my A2K database, I have a form with 2 Unbound Comboboxes, both of which open up forms to a particular record. One of these comboboxes works perfectly. For some reason the 2nd one WILL...
6
by: Andi Plotsky | last post by:
Hi - I sent this request last week, but didn't get an answer to my problem - let's try again: In my A2K database, I have a form with 2 Unbound Comboboxes, both of which open up forms to a...
3
by: hmiller | last post by:
Hey everyone, I am having a hell of a time trying to set this menu system up. Here's what I'm trying to do. Combo Box One; is populated by names under properties "row source" "Phase 1"...
4
by: VK | last post by:
I'm looking for autoexpand <select> list onfocus and collapse it back onselect/onblur (the list is select-one type) I know it is not possible directly, but I've seen here a hack by changing...
2
by: kiranmn75 | last post by:
I want to dynamically populate a combo box through javascript. Data is coming from a array. Sometimes data list may contain items in excess of 2000. Explorer takes more than 5 seconds to...
6
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
0
by: Ture Bergstrøm | last post by:
In my database (Access2003 SP3) I have a combo box, which has a query as row source. This query gets its values from a table with the fields id and field1. Field1 is shown in the box, the key...
1
by: tbeers | last post by:
Quick questions Is there a way to create an autoexpand property in a text or memo field? Thanks Tomb
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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
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
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...
0
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
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...

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.