﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » ComboBox Autocomplete</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 04:52:22 GMT</lastBuildDate><ttl>20</ttl><item><title>ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost18580.aspx</link><description>I have multiple comboboxes on a winform that are bound to&amp;nbsp;business objects.&amp;nbsp; It seems that no matter how I set the Autocomplete, or DropdownStyle, or BindingProperty, I get these results.&lt;/P&gt;&lt;P&gt;If I type very quickly, then the list narrows to the correct item,&lt;/P&gt;&lt;P&gt;If I type too slow, then the list always goes to the item that starts with the letter I just typed.&lt;/P&gt;&lt;P&gt;i.e.&amp;nbsp; If we were to use state abbreviations as an example...&lt;/P&gt;&lt;P&gt;If I type M, then&amp;nbsp;the combobox will select ME. (the first of the M's)&amp;nbsp; If I was wanting the abbreviation MD, and I then slowly type a 'D' after the 'M', then the combobox goes to DE, not MD as I would expect.&amp;nbsp; HOWEVER ! ! ! IF I TYPE MD REALLY QUICKLY, then it works.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Is there some type of event handler that I need to code to change the behavior to what I would expect?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Doug</description><pubDate>Wed, 29 Apr 2009 15:34:02 GMT</pubDate><dc:creator>Doug Birtell</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22959.aspx</link><description>Glad that was it! :D</description><pubDate>Wed, 29 Apr 2009 15:34:02 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22954.aspx</link><description>Hi Greg,&lt;br&gt;
&lt;br&gt;
Thanks a lot, that is exactly what I was looking for.  I tested it and it works just great!, very simple coding. :w00t:</description><pubDate>Wed, 29 Apr 2009 13:21:01 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22953.aspx</link><description>I'm not exactly which event you'd use (parent form loading maybe), but here is how you'd figure out if the combo has only one choice, then select that choice:&lt;br&gt;
&lt;br&gt;
[codesnippet]'-- This determines the count of items that would be in the&lt;br&gt;
'combo if there are NO items from the db. Note that the&lt;br&gt;
'initialization to zero is for clarity...integers are&lt;br&gt;
'initialized to zero automatically.&lt;br&gt;
Dim zeroDbItemCount As Integer = 0&lt;br&gt;
If Me.cboSample.TopMostItem IsNot Nothing Then&lt;br&gt;
zeroDbItemCount = 1&lt;br&gt;
End If&lt;br&gt;
&lt;br&gt;
'-- If the combo has only one db item, select this item. &lt;br&gt;
'Note that we need exactly one more item than our zero count.&lt;br&gt;
If Me.cboSample.Items.Count = zeroDbItemCount + 1 Then&lt;br&gt;
'-- This is kind of lazy, reusing the zeroDbItemCount as the index, but&lt;br&gt;
'this count will also be the actual index of the first db&lt;br&gt;
'item. I.e. if there is no top most item, the first db item has&lt;br&gt;
'an index of zero. If there is a top most item, the first db item&lt;br&gt;
'has an index of 1.&lt;br&gt;
Me.cboSample.SelectedItem = Me.cboSample.Items(zeroDbItemCount)&lt;br&gt;
End If[/codesnippet]&lt;br&gt;
&lt;br&gt;
I just typed this in, so I may have made some typing mistakes, but this should get you going.</description><pubDate>Wed, 29 Apr 2009 13:10:57 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22950.aspx</link><description>[quote][b]Trent L. Taylor (04/29/2009)[/b][hr]Well, first you would just need to bind the combo to the BO. Next, why can't you just set the default value of the field that will be bound?[/quote]&lt;br&gt;
Let me try to explain myself better.&lt;br&gt;
The combobox is bounded to the BO and it is being filled with records, all that is working fine, but in this case a record must be selected, and when there is only one record I want to show that record in the combobox instead of having the user to dropdown the combo and select the only available record.&lt;br&gt;
I can not use the default value since I don't know the PK of the record being filled in the combobox.&lt;br&gt;
&lt;br&gt;
I know I have to add code to check the listview.items.count taking into consideration the "TopMost" item added automatically, but I don't know how to reference the records in the combobox to do the count and then show or select the only item in the list if there is only one item.</description><pubDate>Wed, 29 Apr 2009 12:34:26 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22949.aspx</link><description>Well, first you would just need to bind the combo to the BO.&amp;nbsp; Next, why can't you just set the default value of the field that will be bound?</description><pubDate>Wed, 29 Apr 2009 11:42:04 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22947.aspx</link><description>Thanks Trent.&lt;br&gt;
&lt;br&gt;
On a similar subject, I have a combo that in some cases will only have 2 items, the one added by the TopMost feature and one from the database, I would like to by code, autoselect the one item from the database to be shown in the combo so the user does not have to click the combo to select the only item available, how can this be done?</description><pubDate>Wed, 29 Apr 2009 10:45:14 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22945.aspx</link><description>Fixed.&amp;nbsp; It will be in the next update.</description><pubDate>Wed, 29 Apr 2009 10:35:07 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22904.aspx</link><description>Hi Trent,&lt;br&gt;
Here is the sample posted by Dustin before, I modified to include an SF TextBox with AutoComplete.  To see the problem, just try to tab between the 2 fields, and you will see (hopefully) that nothing will happen, now if you press "Enter" then the cursor will move back and forth the 2 fields as the Tab should also do.&lt;br&gt;
&lt;br&gt;
I am using the latest posted beta.</description><pubDate>Mon, 27 Apr 2009 09:56:52 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22892.aspx</link><description>Edhy,&lt;/P&gt;&lt;P&gt;I just set up a test and it worked.&amp;nbsp; So you may need to produce a sample showing me what your issue is.&amp;nbsp; I set this up using SF textboxes with AutoComplete turned on, so you are going to need to give me more in-depth details to reproduce.&amp;nbsp; Ideally it would be nice to just fire up a sample that shows me what your issue is.&amp;nbsp; Thanks.</description><pubDate>Mon, 27 Apr 2009 08:10:29 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22889.aspx</link><description>Forgot to mention that the problem is also happening with SF Textboxes using the AutoComplete feature.</description><pubDate>Sun, 26 Apr 2009 18:56:03 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22886.aspx</link><description>Trent,&lt;br&gt;
&lt;br&gt;
FYI, setting the TabOrderController.EnterAdvances = True, allow the end user to move from field to field as the Tab should.&lt;br&gt;
I really like this control as there is more developer control to handle the TabOrder and would really like to see this fix so I can use this control in all my projects.</description><pubDate>Sat, 25 Apr 2009 14:09:37 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22583.aspx</link><description>Thanks.</description><pubDate>Wed, 01 Apr 2009 06:52:23 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22579.aspx</link><description>Sorry...this had a low priority since it was only documented in one instance.&amp;nbsp; I will try to get to this soon.&amp;nbsp; Thanks.</description><pubDate>Tue, 31 Mar 2009 21:32:01 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost22547.aspx</link><description>[quote][b]Trent L. Taylor (01/20/2009)[/b][hr]Not yet. I have it on my "cut sheet" but have not worked through this yet. I plan on getting to this before releasing thefinal update of the 1.6.7 build.[/quote]&lt;br&gt;
&lt;br&gt;
Hi Trent,&lt;br&gt;
Is there any work around fix to this issue?  I have a customer waiting for this and using Tab is very important for him since they do a lot of data entry all day and from time to time he comes back to me asking for a fix.</description><pubDate>Mon, 30 Mar 2009 12:14:22 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost21597.aspx</link><description>Thanks for the info.</description><pubDate>Wed, 21 Jan 2009 07:48:36 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost21590.aspx</link><description>Not yet.&amp;nbsp; I have it on my "cut sheet" but have not worked through this yet.&amp;nbsp; I plan on getting to this before releasing the&amp;nbsp;final update of the 1.6.7 build.</description><pubDate>Tue, 20 Jan 2009 23:00:56 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost21577.aspx</link><description>Hi Trent,&lt;/P&gt;&lt;P&gt;Have you find a fix for this one?</description><pubDate>Mon, 19 Jan 2009 08:26:31 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost21205.aspx</link><description>Got it and reproduced it.&amp;nbsp; I will add this to the list.&amp;nbsp; Thanks.</description><pubDate>Tue, 16 Dec 2008 09:02:50 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost21187.aspx</link><description>Trent, Dustin,&lt;P&gt;No mean to rush you, but when you have a chance, see if you can at least duplicate this with the sample I posted.&lt;/P&gt;&lt;P&gt;I have one of those customer which noticed this problem and it is missing the "Tab" functionality in this case and is driving me nuts :w00t:&lt;/P&gt;&lt;P&gt;Of course this is not a show stopper since he can still use the mouse to jump out of the combobox :P</description><pubDate>Mon, 15 Dec 2008 09:38:10 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost21141.aspx</link><description>We'll take a look a this, but it sounds kindof fishy.&amp;nbsp; This should not have an impact on the tab controller.</description><pubDate>Thu, 11 Dec 2008 13:46:29 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost21130.aspx</link><description>Hi Greg,&lt;/P&gt;&lt;P&gt;Sorry, but basically you can not move focus with the keyboard.&amp;nbsp; I modified Dustin's sample to include&amp;nbsp;a TabOrderController to&amp;nbsp;show the problem.&amp;nbsp;</description><pubDate>Thu, 11 Dec 2008 11:53:03 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost21119.aspx</link><description>Maybe in those cases you have use the Enter key?  Just a guess...</description><pubDate>Wed, 10 Dec 2008 16:24:11 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost21116.aspx</link><description>Dustin,&lt;/P&gt;&lt;P&gt;I am having a problem with a combobox and the TabOrderController, when the combo has the following properties setup as follow:&lt;/P&gt;&lt;P&gt;[codesnippet][code]&lt;/P&gt;&lt;P&gt;AutoCompleteMode: Append or SuggestAppend&lt;/P&gt;&lt;P&gt;AutoCompleteSource: ListItems&lt;/P&gt;&lt;P&gt;[/code][/codesnippet]&lt;/P&gt;&lt;P&gt;If you try to tab to the next control, then the cursor will not move from the combobox object, if those properties are set to None, then the tab order works as expected.</description><pubDate>Wed, 10 Dec 2008 16:13:53 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: ComboBox Autocomplete</title><link>http://forum.strataframe.net/FindPost18640.aspx</link><description>Hi Dough,&lt;P&gt;Thake a look at the sample posted by Greg here &lt;A href="http://forum.strataframe.net/FindPost12693.aspx"&gt;http://forum.strataframe.net/FindPost12693.aspx&lt;/A&gt;&amp;nbsp;which has many of the things you are asking for.</description><pubDate>Wed, 20 Aug 2008 15:22:44 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>