473,387 Members | 1,464 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,387 software developers and data experts.

Keypress doesn't work with autocompletemode suggest

wpm
I have a combobox with the following properties set in Visual Basic
2005
AutoCompletMode : Suggest
AutoCompletSource : Listitems
DropDownStyle : DropDown

I need to use a keypress event for the backspace and enter key because
I want to save text that I entered in the combobox to a file.
With the AutoCompletMode : Suggest the event doesn't work. With the
AutoCompletMode : None the event fires.
See below the code I use:

Private Sub Combo1_KeyPress(ByVal Sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles Combo1.KeyPress
Dim msg As String
Dim title As String
Dim style As MsgBoxStyle
Dim response As MsgBoxResult
If e.KeyChar = Chr(8) Or e.KeyChar = Chr(13) And Len(Combo1.Text) <0
Then
If e.KeyChar = Chr(13) Then
e.Handled = True
msg = "Add to database?"
style = MsgBoxStyle.Question Or MsgBoxStyle.YesNo
title = "Database"
response = MsgBox(msg, style, title)
If response = MsgBoxResult.Yes Then
Combo1.Items.Add(Combo1.Text)
Combo2File(My.Application.Info.DirectoryPath &
"\Proces.txt", Combo1)
End If
End If
End If
End Sub

Sep 16 '06 #1
0 1293

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

Similar topics

4
by: phil_gg04 | last post by:
Dear Javascript Experts, I'm currently implementing Anyterm, a terminal emulator on a web page. It consists of an Apache module, some XmlHTTP and a bit of Javascript. The idea is to give you...
7
by: Alex007 | last post by:
Hi, I've been working on this C assignement for a CS course.... the assignement is going pretty well and all my code works well on both Windows and Linux. The only thing that doesn't work is...
0
by: LordHog | last post by:
Hello all, I am trying to implement an event handler for the KeyPress event for a cell within a DataGridView control. The obvous starting point from the DataGridView keypress event, but this...
1
by: Rene | last post by:
Hi, I am running is some problems with the KeyPreview and KeyPress events. The KeyPress event is only triggered when there this an focusable control on the form. When all controls are disabled...
6
by: Niksa Baldun | last post by:
Hi, I am trying to capture data from magnetic stripe reader which is connected via keyboard interface (therefore indistinguishable from normal keyboard input). Basically, I am doing the...
15
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE...
3
by: Fia | last post by:
Hi In Visual Basic 6 I could call keypress with an integer of a choosen key. For example I could call a textbox's keypress with the number 13 (for the enter key). But now in Visual Basic .Net I...
1
by: centur | last post by:
Hello. I created simple asp.net application to search message history over Office Live Communicator conversations. I complete quite all job but stick with one thing - I have autosuggest box...
3
by: =?Utf-8?B?bWVtZWFk?= | last post by:
I have a combobox displaying the full name of a customer (e.g. John Smith) and would like to go to the LAST name whenever a user presses a key while on this combobox. I have looked at the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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...

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.