<?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 - supress Popup</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : ComboBox - supress Popup]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 14 Jun 2026 16:37:12 +0000</pubDate>
  <lastBuildDate>Tue, 06 Jan 2009 13:38:46 +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=13012</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 - supress Popup :    oleg wrote:This code works...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13012&amp;PID=44215&amp;title=combobox-supress-popup#44215</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3379">DDTech</a><br /><strong>Subject:</strong> 13012<br /><strong>Posted:</strong> 06 January 2009 at 1:38pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by oleg" alt="Originally posted by oleg" style="vertical-align: text-bottom;" /> <strong>oleg wrote:</strong><br /><br />&nbsp;<div>This code works for Visual Basic:</div><div>&nbsp;</div><div>Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long</div><div>Private Sub CommandBars_TrackingModeChanged(ByVal CommandBar As XtremeCommandBars.ICommandBar, ByVal Mode As Boolean)<br>&nbsp;&nbsp;&nbsp; If (CommandBar.BarID = 100) Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DestroyWindow CommandBar.hwnd<br>&nbsp;&nbsp;&nbsp; End If<br>End Sub<br>....</td></tr></table><br><br>BANG - this directly sends VFP to hell. Same when I try to do it from within the ControlNotify. <br><br>However,&nbsp; the tip pointed into the right direction. Destroying the window only once seems to be enough, and when I do that directly after initializing the toolbar all further calls report a window handle of "0" and no popup appears. <br><br><font color="#006633" face="Courier New, Courier, mono"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif">So the working code now looks like this:</font><br><br></font><font color="#006633" face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp; loCBO = loToolbar.FindControl(5, ID_SCHEDMAIN_DATE)<br></font><br><font color="#006633" face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp; *-- resize the combo's width to the space needed for <br>&nbsp;&nbsp;&nbsp; *-- display of current date + room for the dropdown-<br>&nbsp;&nbsp;&nbsp; *-- arrow + some "air</font><font color="#006633" face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; loCBO.Width = ;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; txtWidth(dtoc(date()), this.Text1.FontName, this.Text1.FontSize, "B")*;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; fontMetric(6, this.Text1.FontName, this.Text1.FontSize, "B") + sysMetric(5) + lnWidthAdd<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; *-- DD changed on 06.01.09<br>&nbsp;&nbsp;&nbsp; *-- directly delete the combo's Commandbar-Window and<br>&nbsp;&nbsp;&nbsp; *-- by that way prevent it from ever showing up. <br>&nbsp; <br>&nbsp;&nbsp;&nbsp; if loCBO.CommandBar.hWnd &gt; 0<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; declare long DestroyWindow in USER32 as CB_DestroyWindow long hWnd<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CB_DestroyWindow(loCBO.CommandBar.hWnd)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; clear Dlls CB_DestroyWindow<br>&nbsp;&nbsp; endif<br>&nbsp;&nbsp; ...<br></font><br>This seems to work like a charm and clicking the down-arrow shows the calendar as if it ever belonged there.<br>&nbsp;<br></div>]]>
   </description>
   <pubDate>Tue, 06 Jan 2009 13:38:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13012&amp;PID=44215&amp;title=combobox-supress-popup#44215</guid>
  </item> 
  <item>
   <title><![CDATA[ComboBox - supress Popup : Hi,  This code works for Visual...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13012&amp;PID=44109&amp;title=combobox-supress-popup#44109</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 13012<br /><strong>Posted:</strong> 05 January 2009 at 2:52am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>This code works for Visual Basic:</DIV><DIV>&nbsp;</DIV><DIV>Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long</DIV><DIV>Private Sub CommandBars_TrackingModeChanged(ByVal CommandBar As XtremeCommandBars.ICommandBar, ByVal Mode As Boolean)<BR>&nbsp;&nbsp;&nbsp; If (CommandBar.BarID = 100) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DestroyWindow CommandBar.hwnd<BR>&nbsp;&nbsp;&nbsp; End If<BR>End Sub</DIV><DIV>Private Sub Form_Load()</DIV><DIV>CommandBars.EnableOffice2007Frame True<BR>Dim Combo As CommandBarComboBox<BR>Set Combo = CommandBars.ActiveMenuBar.Controls.Add(xtpControlComboBox, 100, "Date")<BR>Combo.DropDownListStyle = False<BR>Combo.Text = "01/01/2009"</DIV><DIV>Dim ComboDropDown As CommandBar<BR>Set ComboDropDown = CommandBars.Add("ComboDropDown", xtpBarPopup)<BR>ComboDropDown.BarID = 100</DIV><DIV>Set Combo.CommandBar = ComboDropDown</DIV><DIV><BR>End Sub<BR></DIV>]]>
   </description>
   <pubDate>Mon, 05 Jan 2009 02:52:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13012&amp;PID=44109&amp;title=combobox-supress-popup#44109</guid>
  </item> 
  <item>
   <title><![CDATA[ComboBox - supress Popup : Oleg,any hint on that?This is...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13012&amp;PID=43943&amp;title=combobox-supress-popup#43943</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3379">DDTech</a><br /><strong>Subject:</strong> 13012<br /><strong>Posted:</strong> 27 December 2008 at 10:14am<br /><br />Oleg,<br><br>any hint on that?<br><br>This is what I want to achieve. <br><br><img src="uploads/20081227_093454_CJDatePick001.PNG" height="184" width="267" border="0" align="baseline"><br><br>This is what I currently do: <br><br>In an initialization procedure, after loading Designerbars, I do some size-Optimization and set the Combo's Dropdown to a width of 1 px. and the ItemCount to 0. This does not make the dropdown not appear but it's only a few pix in size so that the user does not realize.<br><br><br><font color="#006633" face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp; loCBO = loToolbar.FindControl(5, ID_SCHEDMAIN_DATE)<br><br>&nbsp;&nbsp;&nbsp; *-- resize the combo's width to the space needed for <br>&nbsp;&nbsp;&nbsp; *-- display of current date + room for the dropdown-<br>&nbsp;&nbsp;&nbsp; *-- arrow + some "air"<br>&nbsp;&nbsp;&nbsp; loCBO.Width = ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txtWidth(dtoc(date()), this.Text1.FontName, this.Text1.FontSize, "B")*;<br>&nbsp;&nbsp;&nbsp; &nbsp; fontMetric(6, this.Text1.FontName, this.Text1.FontSize, "B")+;<br>&nbsp; &nbsp;&nbsp;&nbsp; + sysMetric(5) + lnWidthAdd<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; *-- try to hide as much of the combo as possible&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; loCBO.DropdownWidth &nbsp;&nbsp;&nbsp; = 1<br>&nbsp;&nbsp;&nbsp;&nbsp; loCBO.DropDownItemCount = 0<br></font><br><br>I then listen to the ControlNotify-event and show the calendar as soon as the user clicks on the down-arrow. The actual ShowCalendar() procedure is separated from the event by calling it via timer with a short delay. This way we can leave the event immediately, which is crucial to avoid "letters to Bill" as I call them (a GPF is almost a sure thing when an error occurs within VFP-Code while still being in some kind of ActiveX-event). A delay of 20ms or even less is safe enough and almost not to realize, <br><br><font color="#006633" face="Courier New, Courier, mono">PROCEDURE ControlNotify(Control as Object, Code as Long, NotifyData as variant, Handled as Variant)<br>&nbsp;&nbsp;&nbsp; if Control.ID = </font><font color="#006633" face="Courier New, Courier, mono">ID_SCHEDMAIN_DATE</font><font color="#006633" face="Courier New, Courier, mono">&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if Code=7 &amp;&amp; Dropdownarrow clicked and popup is about to open<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *-- "handled" is coming in via reference. <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *-- setting it to .T. should tell the toolbar<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *-- "I'll take care of it. Unfortunately it <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *-- does not seem to care. But we're good<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *-- good guys and do behave.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Handled = .t.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; *-- this causes an immediate GPF:&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; *oForm = Create("FORM")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; *oForm.halfHeightcaption = .T.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; *oForm.Show<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *--&gt; letter to Bill<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *-- ... so call the ShowCalender via timer and <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *-- let the event return immediately<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; thisform.tmrAction.doCommand("thisform.ShowCalendar("+ trans(</font><font color="#006633" face="Courier New, Courier, mono">ID_SCHEDMAIN_DATE) +"</font><font color="#006633" face="Courier New, Courier, mono">)")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; endif<br>&nbsp;&nbsp;&nbsp; endif<br>ENDPROC</font><br><br>ShowCalendar opens and positions the form below the control<br><br><font size="2" color="#006633" face="Courier New, Courier, mono">PROCEDURE ShowCalendar(tnControlID as integer) as boolean<br>tnControlID = iif(vartype(tnControlID) = "N", tnItemID, 1101)<br><br></font><font size="2" color="#006633" face="Courier New, Courier, mono">public oCal<br></font><font size="2" color="#006633" face="Courier New, Courier, mono">local&nbsp; a,b,c,d,a1,b1,c1,d1, loTB, loCBO, loCB<br><br>store 0 to a,b,c,d, a1,b1,c1,d1<br><br>loTB&nbsp;&nbsp;&nbsp; = this.TB<br>loCBO &nbsp; = this.TB.FindControl(5, tnControlID)<br><br>if ! isNull(loCBO)<br></font><font size="2" color="#006633" face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp; &amp;&amp; !!!! More generic - Test only !!!</font><br><font size="2" color="#006633" face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp; loCB = loTB.ActiveMenubar.Commandbars(3) <br><br>&nbsp;&nbsp;&nbsp; *-- get rectangles for control and commandbar<br>&nbsp;&nbsp;&nbsp; loCB.GetWindowRect(@a,@b,@c,@d)<br>&nbsp;&nbsp;&nbsp; loCBO.GetRect(@a1,@b1,@c1,@d1)<br><br>&nbsp;&nbsp;&nbsp; *-- frmDatePick is a class that releases itself<br>&nbsp;&nbsp;&nbsp; *-- on lostfocus and binds itself to a target <br>&nbsp;&nbsp;&nbsp; *-- it reports to in case a positive date-selection<br>&nbsp;&nbsp;&nbsp; *-- is made<br>&nbsp;&nbsp;&nbsp; oCal = newObject("frmDatePick", "SCHED_FORMS", "", ThisForm.txtDatum)<br><br>&nbsp;&nbsp;&nbsp; *-- move the form below the date-combo, align with the<br>&nbsp;&nbsp;&nbsp; *-- right border<br>&nbsp;&nbsp;&nbsp; oCal.Move(;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a+c1-oCal.Width-2-_screen.left,;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b-_screen.Top + d1+3)<br><br>&nbsp;&nbsp;&nbsp; oCal.Show<br>endif&nbsp; &amp;&amp; ! isNull(...)<br><br>ENDPROC<br></font><br>This works pretty well, though not the ideal solution. I'd really like to get rid of the combo's popup although the trick is almost perfect.&nbsp; Any recommendations gladly welcome.<br><br>Frank.<br><br><br><br><br>]]>
   </description>
   <pubDate>Sat, 27 Dec 2008 10:14:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13012&amp;PID=43943&amp;title=combobox-supress-popup#43943</guid>
  </item> 
  <item>
   <title><![CDATA[ComboBox - supress Popup : I have a xtpControlComboBox member...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13012&amp;PID=43906&amp;title=combobox-supress-popup#43906</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3379">DDTech</a><br /><strong>Subject:</strong> 13012<br /><strong>Posted:</strong> 25 December 2008 at 11:26am<br /><br /><br>I have a xtpControlComboBox member in one of my toolbars where I would like to show a form (with a date-picker) instead of the popup. <br><br>I thought the right place to look at would be ControlNotify. In this I check the incoming Control.id and if the "code" is 7 (XTP_CBN_DROPTDOWN), I set handled to .t. and expect the popup not to appear. Hovever the control is not impressed of my doing so. <br><br>Any other idea how to acomplish this?<br><br>VFP 9 SP2, WinXP SP2, XtremeCommandbars 12.1.1<br><br>Thanks for any hint<br><br>regards (and merry christmas)<br><br>Frank<br>]]>
   </description>
   <pubDate>Thu, 25 Dec 2008 11:26:31 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13012&amp;PID=43906&amp;title=combobox-supress-popup#43906</guid>
  </item> 
 </channel>
</rss>