Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
tools
vsnet.act
vsnet.debugging
vsnet.documentation
vsnet.enterprise.tools
vsnet.general
vsnet.ide
vsnet.jlca
vsnet.servicepacks
vsnet.setup
vsnet.vsip
vsnet.vss
vsnet.vstools.office
vstudio.development
vstudio.extensibility
vstudio.general
vstudio.helpauthoring
vstudio.setup
vstudio.sourcesafe
  
 
date: Tue, 27 Nov 2007 04:55:00 -0800,    group: microsoft.public.vstudio.extensibility        back       


WPF MonthCalendar and DateTimePicker   
After reading this thread (http://tinyurl.com/3c6358) that I know WPF doesn't 
provide MonthCalendar control and DateTimePicker control, but I can use the 
Kevin's Bag-O-Tricks open source DateTimePicker control. After checking some 
books and websites, I found another way to use the MonthCalendar and 
DateTimePicker using WPF, it suggests me to add the "ElementHost" component 
and put the "WindowsFormHost" component into an instance of Elementhost, then 
we could use the MonthCalendar or DateTimePicker control, but I failed to do 
with it(I can't find the ElementHost component in ToolBox and I can't use the 
WindowsFormHost to contain the MonthCalender control).
--------------------------------------------------------------------------
// Here's the code
Expander expander = new Expander();
expander.Header = "WPF Header";
WindowsFormHost host = new WindowsFormHost();
host.Child = new MonthCalendar();
expander.Content = host;
elementHost.Child = expander;
date: Tue, 27 Nov 2007 04:55:00 -0800   author:   Fikret Huang Fikret am

RE: WPF MonthCalendar and DateTimePicker   
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" 

and then

some in the code use it:

 <WindowsFormsHost Grid.Column="1">
        <wf:WebBrowser x:Name="test" ScrollBarsEnabled="false"/>
      </WindowsFormsHost>


"Fikret Huang" wrote:

> After reading this thread (http://tinyurl.com/3c6358) that I know WPF doesn't 
> provide MonthCalendar control and DateTimePicker control, but I can use the 
> Kevin's Bag-O-Tricks open source DateTimePicker control. After checking some 
> books and websites, I found another way to use the MonthCalendar and 
> DateTimePicker using WPF, it suggests me to add the "ElementHost" component 
> and put the "WindowsFormHost" component into an instance of Elementhost, then 
> we could use the MonthCalendar or DateTimePicker control, but I failed to do 
> with it(I can't find the ElementHost component in ToolBox and I can't use the 
> WindowsFormHost to contain the MonthCalender control).
> --------------------------------------------------------------------------
> // Here's the code
> Expander expander = new Expander();
> expander.Header = "WPF Header";
> WindowsFormHost host = new WindowsFormHost();
> host.Child = new MonthCalendar();
> expander.Content = host;
> elementHost.Child = expander;
date: Tue, 11 Dec 2007 02:01:01 -0800   author:   Nikolay Podkolzin

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us