Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / November 2006

Tip: Looking for answers? Try searching our database.

Data entry into ComboBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
al jones - 26 Nov 2006 19:02 GMT
Okay, I'm probably re-inventing the wheel here, but I have two drop down
boxs on a form.  One is "source" the other "destination",  I'm using a
combobox each to provide MRU utility.

The setting I've changed are:
AutoCompleteMode -> SuggestAppend
AutocompleteSource -> FileSystemDirectory
Drop[DownStyle -> Drop Down
Sorted -> True

I populate the cbo at form load time (well, I would if I had anything with
which to populate it!)

I also have a browse button which sets cbo.text.

I'm having two problems and obviously (as always) don't know what I'm
looking for.

What event(s) are fired when I change the cbo.text - as when I insert it
from the folderbrowserdialogue (need to update the MRU list).
- and -
What event is fired when the user manually enters something and presses
return.  I'm seeing nothing ....

If you can tell me how to tell what event is being fired, that would be
even better.

Thanks //al
lord.zoltar@gmail.com - 26 Nov 2006 19:27 GMT
> Okay, I'm probably re-inventing the wheel here, but I have two drop down
> boxs on a form.  One is "source" the other "destination",  I'm using a
[quoted text clipped - 24 lines]
>
> Thanks //al

When the text in a combo box changes, there is a TextChagned event ;)
when the user changes the selected item, there is a SelectedItemChanged
event.
al jones - 26 Nov 2006 20:40 GMT
>> Okay, I'm probably re-inventing the wheel here, but I have two drop down
>> boxs on a form.  One is "source" the other "destination",  I'm using a
[quoted text clipped - 28 lines]
> when the user changes the selected item, there is a SelectedItemChanged
> event.

Oh, I see, I just had it spelled wrong :)

I've been this round.  What I'm seeing is TextChanged is being triggered
with each character entered (or suggestion accepted) [which I can
understand as one might want to do something as each character is
entered...]  What I'm now seeing in my mru is "D", "D:", "D:\", etc, not
exactly what I had in mind.  However, what I want is to trigger <something>
when they press enter after all the path / folder name has been entered.

I thought that cbox.SelectionChangeCommitted would be invoked - but even
with a breakpoint on the first line, I don't see it getting fired.  Any
ideas what I'm missing here?

... and I'd really appreciate it if your reply wasn't 'stop wanting that!'
:)

//al
lord.zoltar@gmail.com - 26 Nov 2006 21:01 GMT
> Oh, I see, I just had it spelled wrong :)
>
[quoted text clipped - 11 lines]
> ... and I'd really appreciate it if your reply wasn't 'stop wanting that!'
> :)

I just checked, it lookes like the TextChanged event doesn't have any
way of telling you which key was pressed (which makes sense, because
TextChanged can occur due to non-keyboard input). You could listen to
the KeyDown or KeyPress events, because those WILL tell you which key
was pressed (e.keycode or something like that, I forget exactly ;) ).
I don't know if "Enter" key will be  a problem or not... it might
trigger other behaviour, but I doubt it.
al jones - 27 Nov 2006 03:21 GMT
Refreshing this topic a little.  If I change the exit to cbox1.leave then
it depends on the user to use the mouse (or tab) to go to some other box.
I find it hard to believe that MS doesn't have the enter key enabled there
so I'd guess that I'm just missing something.

Now, how do I tell which item they've selected if they select an item from
the dropdown.  Reson being, once they've selected / entered / browsed to
the item, then moved out of the cbobox, I'm not displaying anything in the
text area of the combobox ....

//al

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.