:: Home

  login:         
  passwords:  

WPF FAQs

WPF General Questions
Concepts Element Tree
Concepts Dependency Property
Concepts Attached Property
Concepts Routed Events
Concepts Resources.
Concepts Animation
Concepts Freezable Object
Concepts Input and Commands.
Concepts Layouts
XAML Inline Styles and Templates
XAML XML Namespaces
XAML Code Behind
XAML Custom Class
XAML Type Converters
Content Model ItemControl
Content Model HeaderedItemsControl
Content Model HeaderedContentControl
Content Model Content Control
Content Model Decorator Content Model
Content Model Panel Content Model
Documents Serialization and Storage
Documents Annotations
Documents Flow Content
Documents Printing
Graphics and Multimedia Rendering Graphics
Graphics and Multimedia Animation and Timing
Graphics and Multimedia 2D Graphics
Graphics and Multimedia 3D Graphics
Graphics and Multimedia Visual Layer
Control Customization Adorners
Control Customization Stylable controls
Control Customization ControlTemplates
Data Data Binding
Data DragandDrop
Data Serialization
Globalization and Localization Attributes
Globalization and Localization Comments
Globalization and Localization Globalization Struc
Application and Deployment ClickOnce
Application and Deployment Frame
Application and Deployment Page
Application and Deployment Navigation
Application and Deployment Setup
Application and Deployment Window
Interoperability Message Loops Between
Interoperability Win32 in WPF
Interoperability WPF in Win32
Interoperability Windows Forms and WPF
Security Trusted Security
Security Partial Trust Security
Tools Microsoft Expression Blend
Tools ZAM3D
Tools XAMLPAD
Controls ToolTip
Controls TextBlock
Controls TabControl
Controls ProgressBar
Controls PrintDialog
Controls Popup
Controls TextBox
Controls Canvas
Controls ComboBox
Controls ListBox
Controls StatusBar
Controls ToolBar
Controls Context Menu
Controls Expander
Controls DocumentViewer
Controls FlowDocumentReader
Controls GroupBox
Controls GridSplitter
Controls Image
Controls Menu
Controls ScrollBar
Controls Slider
Controls RichTextBox
Controls Border
Controls Buttons

SilverLight Interview Qs

SAP Interview Questions

Oracle Interview Questions

PHP Interview Questions

Ajax Interview Questions

IIS 7.0

OOP Interview Questions

Ruby Interview Questions

Sql Server Interview Questions

Winforms Interview Questions

SharePoint 2007 Questions

Microsoft Crm Questions

Interoperability Windows Forms and WPF Interview Questions & FAQs

Questions and answers for Interoperability Windows Forms and WPF.

49. Interoperability Windows Forms and WPF

    49.1 Will you provide a tool to convert Windows Forms applications to WPF applications ?
    49.2 What about user controls and third-party controls including ActiveX controls?
    49.3 Where do I find System.Windows.Forms.Integration ?
    49.4 Can I use a WindowsFormsHost element to host a System.Windows.Forms ?

49.1 Will you provide a tool to convert Windows Forms applications to WPF applications ?

At this time, we do not have any plans to release such a tool. We feel that it is more important for us to offer a solution that allows for co-existence of Windows Forms and WPF controls rather than attempt a migration tool that would be difficult to get right.

49.2 What about user controls and third-party controls including ActiveX controls?

Windows Forms user controls will work the same as the standard Windows Forms controls, which means you can certainly use them in WPF applications. As far as third-party controls go, it depends on how these controls are built. If they are built as managed Windows Forms custom controls, they will also work fine in this scenario. If they are built as ActiveX controls, they can also be used in a WPF application as long as they are contained within a WindowsFormsHost control. Since Windows Forms already has support for hosting ActiveX controls, all you need to do is generate the managed wrappers for the ActiveX control and then use those wrappers to instantiate the control and host it within the WindowsFormsHost control on a WPF window or page. One handy way to do this is to simply create a Windows Forms UserControl that contains the ActiveX control and then simply host the UserControl in the WindowsFormsHost control.


49.3 Where do I find System.Windows.Forms.Integration ?

The System.Windows.Forms.Integration namespace is defined in "WindowsFormsIntegration.dll" which currently ships in the WinFX SDK, not in the standard redist. Therefore, the file will be found in "\Program Files\Reference Assemblies\Microsoft\Framework\v3.0".


49.4 Can I use a WindowsFormsHost element to host a System.Windows.Forms ?

It can be done with the following code :

[XAML]

<Window x:Class="HostingWfInWpf.Window1"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"

Title="HostingWfInWpf"

> 

<Grid>

<WindowsFormsHost>

<wf:MaskedTextBox x:Name="mtbDate" Mask="00/00/0000"/>

</WindowsFormsHost>

</Grid>

</Window>

bottom user control
::  Home :: Services ::  Prices ::  Request Quote
Copyright 2007, Megasolutions Ltd