<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : ComboBox.DropDown Event</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : ComboBox.DropDown Event]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 12 May 2026 19:10:46 +0000</pubDate>
  <lastBuildDate>Fri, 13 Dec 2024 08:28:13 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=24535</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[ComboBox.DropDown Event : I&amp;#039;m having trouble calling...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24535&amp;PID=79089&amp;title=combobox-dropdown-event#79089</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9698">nidzolino</a><br /><strong>Subject:</strong> 24535<br /><strong>Posted:</strong> 13 December 2024 at 8:28am<br /><br />I'm having trouble calling the dropdown menu.<br>The combobox control does not have a Find function (search by character) but a completely correct name, I developed a function that initially fills the collection and later uses it for searching. AutoComplete is also not enough because it doesn't search for the word that matches within the text of the item, but the beginning of the item.<br>However, I am facing the following problem. I want to call a drop-down menu (ComboPopUp) right below the ComboBox, so that as the user types, they see the search result immediately.<br><br><br>The problem, as far as I understand, is that I can't call ShowPopUp because xtpBarComboBoxGalleryPopup doesn't have that property! How can I solve this problem?<div><br><span style=": rgb240, 241, 245;"><table width="99%"><tr><td><pre class="BBcode"></span><br>Private Sub FillData()<br><br><div>&nbsp; &nbsp;Dim ComboBox As CommandBarComboBox</div><div>&nbsp; &nbsp;Dim ComboPopUp As CommandBar</div><div>&nbsp; &nbsp;Dim Gallery As CommandBarGallery</div><div>&nbsp; &nbsp;Dim Items As CommandBarGalleryItems</div><div><br></div><div>&nbsp; &nbsp;Dim Key As Variant</div><div>&nbsp; &nbsp;Dim count As Integer</div><div><br></div><div>&nbsp; &nbsp;Set ComboBox = MenuBar.Controls.Add(xtpControlComboBox, 999, "&amp;Data", -1, False)</div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboBox.AutoComplete = False</div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboBox.Width = 500</div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboBox.DropDownItemCount = 20</div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboBox.DropDownWidth = 1000</div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboBox.DropDownListStyle = True</div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboBox.EditHint = "Data..."</div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboBox.CloseSubMenuOnClick = True</div><div>&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp;Set ComboPopUp = CommandBarsFrame.Add("ComboPopUp", xtpBarComboBoxGalleryPopup)</div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboPopUp.BarID = 1010</div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboPopUp.Title = "ComboPopUp"</div><div>&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp;Set Gallery = ComboPopUp.Controls.Add(xtpControlGallery, 1111, "Gallery")</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Gallery.Width = 1000</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Gallery.Height = 508</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Gallery.resizable = xtpAllowResizeWidth Or xtpAllowResizeHeight</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Gallery.Caption = "Gallery"</div><div>&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp;Set rstTMP = New ADODB.Recordset</div><div><br></div><div>&nbsp; &nbsp;rstTMP.CursorLocation = adUseClient</div><div>&nbsp; &nbsp;rstTMP.LockType = adLockReadOnly</div><div>&nbsp; &nbsp;rstTMP.CursorType = adOpenStatic</div><div><br></div><div>&nbsp; &nbsp;Set DataItemsListOfICD = New Scripting.Dictionary</div><div><br></div><div>&nbsp; &nbsp;If OpenSQL(rstTMP, clO_LIST_OF_ICD) Then</div><div><br></div><div>&nbsp; &nbsp; &nbsp; Do While Not rstTMP.EOF</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DataItems.Add CVal(rstTMP("GLOICD_ID"), clBT_NUMBER), CVal(rstTMP("GLOICD_Code"), clBT_STRING) &amp; " - " &amp; CVal(rstTMP("GLOICD_Translation"), clBT_STRING)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rstTMP.MoveNext</div><div>&nbsp; &nbsp; &nbsp; Loop</div><div><br></div><div>&nbsp; &nbsp;End If</div><div><br></div><div>&nbsp; &nbsp;Set Items = CommandBarsFrame.CreateGalleryItems(1212)</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Items.ItemWidth = 0</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Items.ItemHeight = 38</div><div>&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Items.AddLabel "History"</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Items.AddItem 1, "A01"</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Items.AddLabel "All data"</div><div><br></div><div>&nbsp; &nbsp;For Each Key In DataItems.Keys</div><div>&nbsp; &nbsp; &nbsp; Items.AddItem Key, DataItems(Key)</div><div>&nbsp; &nbsp; &nbsp; Items.item(Items.count - 1).Enabled = True</div><div>&nbsp; &nbsp;Next</div><div><br></div><div>&nbsp; &nbsp;Set Gallery.Items = Items</div><div>&nbsp; &nbsp;Set ComboBox.CommandBar = ComboPopUp</div><div><br></div><div>&nbsp; &nbsp;Set Key = Nothing</div><div><br></div><div>&nbsp; &nbsp;Set ComboPopUp = Nothing</div><div>&nbsp; &nbsp;Set Items = Nothing</div><div>&nbsp; &nbsp;Set Gallery = Nothing</div><div>&nbsp; &nbsp;Set ComboBox = Nothing</div><div><br></div><div>&nbsp; &nbsp;Set rstTMP = Nothing</div><div><br>End Sub<br><br><br><div>Private Sub CommandBarsFrame_CommandBarKeyDown(CommandBar As XtremeCommandBars.ICommandBar, KeyCode As Long, Shift As Integer)</div><div><br></div><div>&nbsp; &nbsp;Dim ComboBox As CommandBarComboBox</div><div><br></div><div>&nbsp; &nbsp;Set ComboBox = CommandBarsFrame.FindControl(, 999)</div><div><br></div><div>&nbsp; &nbsp;If ComboBox Is Nothing Then Exit Sub</div><div><br></div><div>&nbsp; &nbsp;Select Case KeyCode</div><div><br></div><div>&nbsp; &nbsp; &nbsp; Case vbKeyBack</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If Len(ComboBox.Text) &gt; 0 Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ComboBox.Text = Left(ComboBox.Text, Len(ComboBox.Text) - 1)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End If</div><div>&nbsp; &nbsp; &nbsp; Case vbKeyDelete</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ComboBox.Text = ""</div><div>&nbsp; &nbsp; &nbsp; Case Else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ComboBox.Text = ComboBox.Text &amp; Chr(KeyCode)</div><div>&nbsp; &nbsp;End Select</div><div><br></div><div>&nbsp; &nbsp;Call UpdateComboBox(ComboBox)</div><div><br></div><div>End Sub</div></div><div><br><div>Private Sub UpdateComboBox(ComboBox As CommandBarComboBox)</div><div><br></div><div>&nbsp; &nbsp;Dim ComboPopUp As CommandBar</div><div>&nbsp; &nbsp;Dim Gallery As CommandBarGallery</div><div>&nbsp; &nbsp;Dim Items As CommandBarGalleryItems</div><div>&nbsp; &nbsp;Dim Key As Variant</div><div>&nbsp; &nbsp;Dim results As Scripting.Dictionary</div><div>&nbsp; &nbsp;Dim count As Integer</div><div>&nbsp; &nbsp;</div><div>&nbsp; &nbsp;On Error GoTo Handler</div><div><br></div><div>&nbsp; &nbsp;count = 0</div><div><br></div><div>&nbsp; &nbsp;Set results = New Scripting.Dictionary</div><div><br></div><div>&nbsp; &nbsp;If Len(ComboBox.Text) &gt; 0 Then</div><div>&nbsp; &nbsp; &nbsp; For Each Key In DataItemsListOfICD.Keys</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If InStr(1, DataItemsListOfICD(Key), ComboBox.Text, vbTextCompare) &gt; 0 Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; results.Add Key, DataItemsListOfICD(Key)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count = count + 1</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If count &gt;= 100 Then Exit For</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End If</div><div>&nbsp; &nbsp; &nbsp; Next</div><div>&nbsp; &nbsp;End If</div><div>&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp;Set Gallery = ComboBox.CommandBar.FindControl(xtpControlGallery, 1212)</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Gallery.Items.DeleteAll</div><div>&nbsp; &nbsp;</div><div>&nbsp; &nbsp;Set Items = Gallery.Items</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Items.AddLabel "History"</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Items.AddItem 1, "A01"</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Items.AddLabel "All data"</div><div><br></div><div>&nbsp; &nbsp;Set ComboPopUp = Gallery.Parent&nbsp;</div><div><br></div><div>&nbsp; &nbsp;If results.count &gt; 0 Then</div><div>&nbsp; &nbsp; &nbsp; For Each Key In results.Keys</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Items.AddItem Key, results(Key)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Items.item(Items.count - 1).Enabled = True</div><div>&nbsp; &nbsp; &nbsp; Next</div><div>&nbsp; &nbsp;ElseIf Len(ComboBox.Text) &gt; 0 Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboBox.AddItem "No results: " &amp; ComboBox.Text</div><div>&nbsp; &nbsp;End If</div><div>&nbsp;</div><div>&nbsp; &nbsp;Set Gallery.Items = Items</div><div>&nbsp; &nbsp;</div><div>&nbsp; &nbsp;Set ComboBox.CommandBar = ComboPopUp</div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboPopUp.RecalcLayout</div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboPopUp.RedrawBar</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp;ComboPopUp.ShowPopup , ComboBox.Left, ComboBox.Top + ComboBox.Height</div><div>&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp;Dim rs As RECT</div><div>&nbsp; &nbsp;ComboBox.GetRect rs.Left, rs.Top, rs.Right, rs.Bottom</div><div>&nbsp; &nbsp;</div><div>&nbsp; &nbsp;CommandBar.Controls.Find(, 999).CommandBar.ShowPopup , 50, 50</div><div>&nbsp; &nbsp;Set ComboPopUp = ComboBox.Controls.Find(, 999).CommandBar</div><div><br></div><div>&nbsp; &nbsp; ComboPopUp.ShowPopup , rs.Left, rs.Top</div><div><br></div><div>End Sub<br><br><span style=": rgb240, 241, 245;"></pre></td></tr></table></span></div></div></div>]]>
   </description>
   <pubDate>Fri, 13 Dec 2024 08:28:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24535&amp;PID=79089&amp;title=combobox-dropdown-event#79089</guid>
  </item> 
 </channel>
</rss>