Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
I write a code on combobox value change event. I want to execute it only when I change my combobox value manually. But whenever I write code e.g. cmb1.text="" . At that instance the combobox change value event is executed. But I don't want it. I want it to execute only when I change the combobox value by clicking on that combobox.
Posted 22-Nov-12 3:00am
dcba1895
Comments
Krunal R at 22-Nov-12 8:04am
   
Can show show your code, so that I got more idea for your query ??
smp 234 at 22-Nov-12 8:15am
   
Only want to execute that event when I click on combo box and change value manually.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

The SelectedIndexChanged event will fire when you set the Text to a value that exists in the dropdown list part of the combobox. If it is firing when you assign an empty string then there must be an empty string in the list.
 
A very useful event is SelectionChangeCommitted as this is raised only when the user changes the selection and not when values are changed programmatically.
 
SelectionChangeCommitted[^]
 
Alan.
  Permalink  
Comments
smp 234 at 23-Nov-12 0:41am
   
thanks... my problem is solved

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 265
1 CPallini 235
2 OriginalGriff 233
3 Maciej Los 195
4 George Jonsson 170
0 OriginalGriff 5,305
1 DamithSL 4,382
2 Maciej Los 3,760
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,901


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100