473,563 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pull down combobpx

Hi All:

How can I activate the spacebar to pull down the combobox?

For instance, once the tab stopped at the combobox, suppose i can use dnarrow
or F4 to pull down the combobox to make selection, but instead of these 2
keys, I want to use spacebar, can I do that?

Best rgds,
Ivan Vong
--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #1
10 1480
"Ivan V via DotNetMonster.c om" <fo***@DotNetMo nster.com> schrieb:
How can I activate the spacebar to pull down the combobox?


Set the control's 'DroppedDown' property to 'True'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2
In article <52***********@ DotNetMonster.c om>, fo***@DotNetMon ster.com
says...
Hi All:

How can I activate the spacebar to pull down the combobox?

For instance, once the tab stopped at the combobox, suppose i can use dnarrow
or F4 to pull down the combobox to make selection, but instead of these 2
keys, I want to use spacebar, can I do that?


I would subclass the regular combobox and handle the OnKeyDown method:

Public Class MyComboBox
Inherits ComboBox

' abstract method. just call base class method
Protected Overrides Sub RefreshItem(ByV al index As Integer)
MyBase.RefreshI tem(index)
End Sub

' abstract method. just call base class method
Protected Overrides Sub SetItemsCore(By Val items As
System.Collecti ons.IList)
MyBase.SetItems Core(items)
End Sub

Protected Overrides Sub OnKeyDown(ByVal e As KeyEventArgs)
If e.KeyCode = Keys.Space Then
Me.DroppedDown = Not Me.DroppedDown
e.Handled = True
End If
End Sub
End Class

All this does is that when the space key is pressed, it will toggle the
dropdown to either on or off.

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 21 '05 #3
i did try, but it's not working!!!
--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #4
both method is not working!
--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #5
In article <52***********@ DotNetMonster.c om>, fo***@DotNetMon ster.com
says...
both method is not working!


The code was copied directly out of a working project. Could you give
more detail as to what "is not working" means? Are you getting errors?
Can you provide some sample code?

This is a winform app, correct?

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 21 '05 #6
Yes, it's a vb.net application. I just simply add the code that you provided
to me. My comob box named Type, and nothing had changed when the code has
been added!!!
--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #7
In article <52***********@ DotNetMonster.c om>, fo***@DotNetMon ster.com
says...
Yes, it's a vb.net application. I just simply add the code that you provided
to me. My comob box named Type, and nothing had changed when the code has
been added!!!


You also need to change the VS.NET generated code. Right now it's
creating a standard System.Windows. Forms.ComboBox. You'd need to change
that to "MyComboBox " (if you use the sample code I provided).

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 21 '05 #8
Thanks Patrick, it works great for me now. How about to activate the up arrow
and down arrow in our keyboard in a window from as the function of tab key?
--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #9
In article <52***********@ DotNetMonster.c om>, fo***@DotNetMon ster.com
says...
Thanks Patrick, it works great for me now. How about to activate the up arrow
and down arrow in our keyboard in a window from as the function of tab key?


I'm not sure what you're asking. Do you want the up/down arrow keys to
allow you to move focus around the form like TAB and SHIFT+TAB? Or do
you want the TAB and SHIFT+TAB keys to act like the up/down arrow keys?

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 21 '05 #10

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

Similar topics

11
2043
by: Mike | last post by:
I need to be able to pull the current <Title> tag from the header into the body of the html page. We started coding this with php, and we were able to get it working. However the entire page is being parsed and really bogging down the system and the pages load very slowly. (the system is Dual P4 2.4, 1GB ram, Redhat 9.0) To fix this we...
5
4770
by: Glenn Mulno | last post by:
Hi, I am trying to create a report page for several teams. Each team runs the same reports but the reports use different values. For a while this was getting insane everytime I updated the queries I had to change them in many places. Then I started using server side includes to keep me from changing some items in multiple places. ...
1
1493
by: NEUE | last post by:
Hello, I'm trying to have a layer appear on top of a simple pull-down menu, but in IE6 the pull-down menu always appears on top. Even if I put the pull-down in a layer under the other layers, it shows on top. On Firefox and all Mac browsers is fine. Any way around this? Thanks NF
5
5363
by: judiphuongtu | last post by:
I am trying to create an input form with a pull-down menu that allows a user to add an item to the pull-down. I don't want the page to refresh when I refresh the pull-down since there's entries on the form already. Please help! Thanks. jptu
0
560
by: guidopapinino | last post by:
What I want to do is have 2 pull down lists, for example a state pull down list and a city pull down list. What I would like to have done is when you select a state from the state pull down list then the city pull down list will populate with all the cities from that selected state. I know that is a lot of data but that is just an example. Or...
1
1678
by: dkimbrell | last post by:
Hi there, I'm very novice to web design. I'm trying to make a pulldown menu, but the formatting keeps getting screwed up when you roll the mouse over it. Please see www.boundarysys.com for what I'm talking about. Before the mouse touches the pulldown, the vertical height of the menubar is perfect. As soon as the mouse rolls over it, it...
1
1495
by: SpankyTClown | last post by:
Hi, Problem: How do I create a form that contains a pull down list for the source and destination (reference the table definition shown below) that shows the name of the item not the id number? The way I am doing it is through a query which only allows one name field. So I thought to do it through the pull down list, but it only displays...
1
3980
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. Depends on the pull down list selection, I use script.aculo.us to validate the user input before submit and pass the necessary data, such as contact...
5
3979
by: giandeo | last post by:
Hello Experts. Could you find a solution for this problem please! I have the following tables in Access Database Table Name: origin Fields Names: country, countrycode Table Name: make Fields Names: countrycode, make
0
7580
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8103
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...
1
7634
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...
0
7945
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...
0
5208
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3634
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2079
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
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.