<?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 : Add DateTimePicker to a RibbonBar</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Add DateTimePicker to a RibbonBar]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 09:46:31 +0000</pubDate>
  <lastBuildDate>Sat, 15 Feb 2014 14:15:37 +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=14773</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[Add DateTimePicker to a RibbonBar : I had the same problem and solved...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14773&amp;PID=72265&amp;title=add-datetimepicker-to-a-ribbonbar#72265</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2278">markp.uk</a><br /><strong>Subject:</strong> 14773<br /><strong>Posted:</strong> 15 February 2014 at 2:15pm<br /><br />I had the same problem and solved it with a combo box. handle the position problem in the InitCommandsPopup event of the command bar, as below.<div><br></div><div><div>&nbsp; Dim Combo &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;As CommandBarComboBox</div></div><div><div>&nbsp; Dim Control &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;As CommandBarControl</div></div><div><div>&nbsp; Dim DatePicker &nbsp; &nbsp; &nbsp; As XtremeCalendarControl.DatePicker</div></div><div><br></div><div><br></div><div><div>If CommandBar.Parent.Type = xtpControlComboBox Then</div><div>&nbsp; &nbsp; &nbsp; Set Combo = CommandBar.Parent</div><div>&nbsp; &nbsp; &nbsp; Set Control = Combo</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; Select Case Combo.Id</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Case ID_PREDICT_START, ID_CHART_START</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dppStart.VisualTheme = xtpCalendarThemeResource</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Set DatePicker = dppStart</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strCurrentDate = m_strPopupStartDay</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Case ID_PREDICT_END, ID_CHART_END</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dppEnd.VisualTheme = xtpCalendarThemeResource</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Set DatePicker = dppEnd</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strCurrentDate = m_strPopupEndDay</div><div>&nbsp; &nbsp; &nbsp; End Select</div><div>&nbsp; &nbsp; &nbsp; If Combo.Id = ID_PREDICT_START Or Combo.Id = ID_PREDICT_END Or Combo.Id = ID_CHART_START Or Combo.Id = ID_CHART_END Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; 'get the current value of the combo box</div><div>&nbsp; &nbsp; &nbsp; &nbsp; strCurrentDate = Combo.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; bRestore = False</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; If IsDate(Combo.Text) Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DatePicker.EnsureVisible Combo.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Combo.GetRect lngLeft, lngTop, lngRight, lngBottom</div><div>&nbsp; &nbsp; &nbsp; &nbsp; 'GetPosition lngLeft, lngTop, CommandBar, Combo</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; DatePicker.Left = lngLeft</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; DatePicker.Top = lngTop + (lngBottom - lngTop)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Debug.Print lngTop</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; If DatePicker.ShowModal(1, 1) Then</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dim strDate0 &nbsp; &nbsp; &nbsp; &nbsp; As String, strDate1 As String</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dim nCount &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; As Long</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nCount = DatePicker.Selection.BlocksCount</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If nCount &gt; 0 Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'Control.Refresh</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Combo.Clear</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Combo.AddItem DatePicker.Selection.Blocks(0).DateBegin</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Combo.AutoComplete = True</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Combo.Text = DatePicker.Selection.Blocks(0).DateBegin</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strDate0 = DatePicker.Selection.Blocks(0).DateBegin</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strDate1 = DatePicker.Selection.Blocks(nCount - 1).DateEnd</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Combo.Clear</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Combo.AddItem strCurrentDate</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Combo.Text = strCurrentDate</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strCurrentDate = "?-?-?"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Combo.Clear</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Combo.AddItem strCurrentDate</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Combo.Text = strCurrentDate</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strCurrentDate = "?-?-?"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; End If<span style="line-height: 1.4;">&nbsp;&nbsp;</span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; Combo.ListIndex = 1</div><div>&nbsp; &nbsp; &nbsp; &nbsp; cbMain_TrackingModeChanged CommandBar, False</div><div>&nbsp; &nbsp; &nbsp; &nbsp; SendKeys vbCrLf</div><div>&nbsp; &nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; End If</div></div><div><br></div><div>works fine for me. good luck</div>]]>
   </description>
   <pubDate>Sat, 15 Feb 2014 14:15:37 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14773&amp;PID=72265&amp;title=add-datetimepicker-to-a-ribbonbar#72265</guid>
  </item> 
  <item>
   <title><![CDATA[Add DateTimePicker to a RibbonBar : Can&amp;#039;t test it right now,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14773&amp;PID=51099&amp;title=add-datetimepicker-to-a-ribbonbar#51099</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3745">JantjeKeizer</a><br /><strong>Subject:</strong> 14773<br /><strong>Posted:</strong> 19 July 2009 at 7:00pm<br /><br />Can't test it right now, but in my experience setting the handle property of the actual control often causes problems. <br />Try to place it in a picturebox and give that handle.]]>
   </description>
   <pubDate>Sun, 19 Jul 2009 19:00:58 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14773&amp;PID=51099&amp;title=add-datetimepicker-to-a-ribbonbar#51099</guid>
  </item> 
  <item>
   <title><![CDATA[Add DateTimePicker to a RibbonBar : Hi,  I was just wondering in...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14773&amp;PID=51097&amp;title=add-datetimepicker-to-a-ribbonbar#51097</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2368">cmm2006</a><br /><strong>Subject:</strong> 14773<br /><strong>Posted:</strong> 19 July 2009 at 3:42pm<br /><br />Hi, <DIV>I was just wondering in how to add a custom control (DateTimePikcer) to a ribbonbar. when I tried the following code:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;Set ItemCustom = GroupView.Add(xtpControlCustom, ID_VIEW_BY_DATE, "By Date:", True, True)<BR>&nbsp;&nbsp;&nbsp; ItemCustom.Handle = TimePicker.hWnd</DIV><DIV><BR>&nbsp;</DIV><DIV>the DateTimePicker control is shown on the ribbonbar with no problem when I first run the application, but the caption "By Date: " is not shown, plus when I click the dropdown arrow to select the date, the DateTimePicker is moved to the default location where was first place in the design mode.</DIV><DIV>Any idea why or how to get this to work?</DIV><DIV>Thank you</DIV>]]>
   </description>
   <pubDate>Sun, 19 Jul 2009 15:42:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14773&amp;PID=51097&amp;title=add-datetimepicker-to-a-ribbonbar#51097</guid>
  </item> 
 </channel>
</rss>