DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   VB.NET (http://www.daniweb.com/forums/forum58.html)
-   -   ComboBox Events (http://www.daniweb.com/forums/thread21153.html)

gcc777 Mar 30th, 2005 11:43 am
ComboBox Events
 
What event can I use that will:

Retain value when leaving field: Lostfocus, leave, enter, etc, Value works with
the exception of Tab, also fires with every keystroke, lostfocus & leave will
not work with all ways of leaving field.

Help

MrConfused Mar 30th, 2005 12:47 pm
Re: ComboBox Events
 
I think you need to explain the problem in more detail; I don't understand the question.

Comatose Mar 30th, 2005 1:22 pm
Re: ComboBox Events
 
Yeah, If you could help me with a clearer picture... or even zip and attach the project so we can see what you are doing, that would be outstanding!

gcc777 Mar 30th, 2005 2:01 pm
Re: ComboBox Events
 
Control is an Infragistics combobox with grid.
I'm using VB.net

Objective: Run sub after leaving combobox.

Problem: Lostfocus & Enter - does not hold combobox value when leaving field
Leave - Works if value is in grid, otherwise no
ValueChanged - works the best, but fires every time, Tab key will pull
first row when value in combo is not contained in
grid, Enter key will work

Comatose Mar 30th, 2005 2:24 pm
Re: ComboBox Events
 
Ok, I'm Moving this thread to VB.Net

cpopham Mar 31st, 2005 11:19 pm
Re: ComboBox Events
 
You can set up one sub and then set it to handle all of the events such as on lostfocus on mouseleave, etc. Then you could assign the row value to a variable possibly...

Chester

goaldrush Apr 4th, 2005 2:56 am
Re: ComboBox Events
 
Quote:

Originally Posted by gcc777
What event can I use that will:

Retain value when leaving field: Lostfocus, leave, enter, etc, Value works with
the exception of Tab, also fires with every keystroke, lostfocus & leave will
not work with all ways of leaving field.

Help

Wait on are you using radio buttons and check boxes? If you are it should be rad or chk in a combo box.

Paladine Apr 5th, 2005 2:54 pm
Re: ComboBox Events
 
Quote:

Objective: Run sub after leaving combobox.

Problem: Lostfocus & Enter - does not hold combobox value when leaving field
Leave - Works if value is in grid, otherwise no
ValueChanged - works the best, but fires every time, Tab key will pull
first row when value in combo is not contained in
grid, Enter key will work

Ok so let me see if I get this? You have a combobox with data values in it, and when the user selects a value you want it retained, but it is not being retained?

From what you have stated, the value grabbed when the "tab" key is pressed is the first row? If that because the user has not selected the value in the combobox, and it is left blank? Cause if the user just enters the combobox and does not select a value, and tabs out of the combobox, this could be true that first row "by default" is grabbed, as it depends on how you setup your code/data binding.

But what you have stated isnt very clear. If we could see some of the code around this combobox setup it would certainly helps us find a solution to you.

And goaldrush:

What do you mean rad or chk in combobox? Is there something that you are aware of that we are not?

As well how does Radio buttons or check boxes change the original question consideration here.

Quote:

Originally Posted by goaldrush
Wait on are you using radio buttons and check boxes? If you are it should be rad or chk in a combo box.


gaurav1004 May 17th, 2007 1:57 am
Re: ComboBox Events
 
Quote:

Originally Posted by gcc777 (Post 106801)
What event can I use that will:

Retain value when leaving field: Lostfocus, leave, enter, etc, Value works with
the exception of Tab, also fires with every keystroke, lostfocus & leave will
not work with all ways of leaving field.

Help

how to write code for combobox

gaurav1004 May 17th, 2007 1:58 am
Re: ComboBox Events
 
how to write code in combobox


All times are GMT -4. The time now is 5:29 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC