SelectionChangeCommitted event fires twice
Hi,
Please have a look at the following ComboBox behavior.
With the code below, if you click in the dropdown list with the mouse
to select an item , everything is fine.
But if you use the Enter key to select in the dropdown list, the
SelectionChangeCommitted event is fired twice.
How can I cancel the second event firing ?
Thanks
ML
'#### BEGIN CODE ##################
Private Sub FormTest_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
ComboBox1.Items.Add("My item 1")
ComboBox1.Items.Add("My item 2")
ComboBox1.Items.Add("My item 3")
End Sub
Private Sub ComboBox1_SelectionChangeCommitted(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
ComboBox1.SelectionChangeCommitted
MsgBox("test")
End Sub
'#### END CODE ################## 5 6785
Hi ML,
I have tested it with VS2005. This code does not show the problem you
report (?).
-tom do**@globetrotter.net ha scritto:
SelectionChangeCommitted event fires twice
Hi,
Please have a look at the following ComboBox behavior.
With the code below, if you click in the dropdown list with the mouse
to select an item , everything is fine.
But if you use the Enter key to select in the dropdown list, the
SelectionChangeCommitted event is fired twice.
How can I cancel the second event firing ?
Thanks
ML
'#### BEGIN CODE ##################
Private Sub FormTest_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
ComboBox1.Items.Add("My item 1")
ComboBox1.Items.Add("My item 2")
ComboBox1.Items.Add("My item 3")
End Sub
Private Sub ComboBox1_SelectionChangeCommitted(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
ComboBox1.SelectionChangeCommitted
MsgBox("test")
End Sub
'#### END CODE ##################
Hi Tom,
Sorry I did not specify that I'm using VS .Net 2003. to**************@uniroma1.it wrote:
Hi ML,
I have tested it with VS2005. This code does not show the problem you
report (?).
-tom
do**@globetrotter.net ha scritto:
SelectionChangeCommitted event fires twice
Hi,
Please have a look at the following ComboBox behavior.
With the code below, if you click in the dropdown list with the mouse
to select an item , everything is fine.
But if you use the Enter key to select in the dropdown list, the
SelectionChangeCommitted event is fired twice.
How can I cancel the second event firing ?
Thanks
ML
'#### BEGIN CODE ##################
Private Sub FormTest_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
ComboBox1.Items.Add("My item 1")
ComboBox1.Items.Add("My item 2")
ComboBox1.Items.Add("My item 3")
End Sub
Private Sub ComboBox1_SelectionChangeCommitted(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
ComboBox1.SelectionChangeCommitted
MsgBox("test")
End Sub
'#### END CODE ##################
ML,
In addition to Tommasso, I did not test it, but found it curious that you
would get an error with this code.
Are you sure that the error is not because that you are selecting inside the
event?
Cor
<do**@globetrotter.netschreef in bericht
news:11**********************@m79g2000cwm.googlegr oups.com...
SelectionChangeCommitted event fires twice
Hi,
Please have a look at the following ComboBox behavior.
With the code below, if you click in the dropdown list with the mouse
to select an item , everything is fine.
But if you use the Enter key to select in the dropdown list, the
SelectionChangeCommitted event is fired twice.
How can I cancel the second event firing ?
Thanks
ML
'#### BEGIN CODE ##################
Private Sub FormTest_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
ComboBox1.Items.Add("My item 1")
ComboBox1.Items.Add("My item 2")
ComboBox1.Items.Add("My item 3")
End Sub
Private Sub ComboBox1_SelectionChangeCommitted(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
ComboBox1.SelectionChangeCommitted
MsgBox("test")
End Sub
'#### END CODE ################## do**@globetrotter.net wrote:
SelectionChangeCommitted event fires twice
Hi,
Please have a look at the following ComboBox behavior.
With the code below, if you click in the dropdown list with the mouse
to select an item , everything is fine.
But if you use the Enter key to select in the dropdown list, the
SelectionChangeCommitted event is fired twice.
How can I cancel the second event firing ?
Reproduced in 2003 - thanks for the complete sample.
I think your options are:
- upgrade (I know this probably isn't an available option)
- rework your app so that it isn't a problem that this event fires twice
in these circumstances - how about you only do whatever you want to do
on selection change if the selection *actually changes* - ie, keep a
separate track of what the current selection is, and if you get a
SelectionChangeCommitted but the new selection is the same as the
current stored selection, don't do anything.
--
Larry Lard la*******@googlemail.com
The address is real, but unread - please reply to the group
For VB and C# questions - tell us which version
Docw,
I call the combobox for myself always the bugbox.
By the way, you know that there is a servicepack for Net 1.1, I don't know
if your problem is fixed in that. http://www.microsoft.com/downloads/d...7-034d1e7cf3a3
Cor
<do**@globetrotter.netschreef in bericht
news:11**********************@m79g2000cwm.googlegr oups.com...
SelectionChangeCommitted event fires twice
Hi,
Please have a look at the following ComboBox behavior.
With the code below, if you click in the dropdown list with the mouse
to select an item , everything is fine.
But if you use the Enter key to select in the dropdown list, the
SelectionChangeCommitted event is fired twice.
How can I cancel the second event firing ?
Thanks
ML
'#### BEGIN CODE ##################
Private Sub FormTest_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
ComboBox1.Items.Add("My item 1")
ComboBox1.Items.Add("My item 2")
ComboBox1.Items.Add("My item 3")
End Sub
Private Sub ComboBox1_SelectionChangeCommitted(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
ComboBox1.SelectionChangeCommitted
MsgBox("test")
End Sub
'#### END CODE ################## This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: George Hartas |
last post by:
I am using Visual C# .NET 2003 to make a ComboBox accept
both mouse and keyboard selection. For mouse selection
code, I double-clicked ComboBox to get the
default "comboBox1_SelectedIndexChanged"...
|
by: Shravan |
last post by:
Hi,
There is a bug in combobox selectionchangecommitted
event firing, I took a combobox of style dropdownlist, I
dropped down it using mouse and using Alt+Up Arrow key
closed the dropdown,...
|
by: PeterZ |
last post by:
G'day,
After doing much searching and pinching bits of ideas from here there and
everywhere I came up with a fairly 'clean' solution of including a comboBox
into a dataGrid column.
You can...
|
by: simchajoy2000 |
last post by:
Hi,
I know there are a lot of postings out there concerning this subject
already, but so far I have not discovered anything that meets my
specific needs. Everything I have found populates the...
|
by: Kalvin |
last post by:
I have a combobox, when I use the mouse and click an item, then the
SelectionChangeCommitted event fires. However, if I use the arrow keys
and move up or down the list to a new item, then this...
|
by: shumaker |
last post by:
I have a combobox that is very much like the one found in the RSS
project here:
http://msdn.microsoft.com/vstudio/express/visualCSharp/learning/
My projectNameComboBox basically is filled with a...
|
by: Frnak McKenney |
last post by:
Can I use a bound ComboBox for both browsing and editing?
I'm working on a small, standalone database application using Visual
C#.NET 2003 and an Access data file.
In order to keep the number...
|
by: Doug Bell |
last post by:
Hi I am still having problems with Tabbing through a DataGrid with a
DataGridComboBox Column.
I need to allow the User to Type the value into the ComboBox so consequently
its ComboBoxStyle is...
|
by: David Jackson |
last post by:
Hello,
I have an unbound DataGridView of which one of the columns is a ComboBox
colum containing category data, plus an additional option called <newSo
when the ComboBox is dropped down it looks...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |