.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> WPF >> Post New Question Subscribe to Interview Questions

Can I use user controls and third-party controls including ActiveX controls in WPF?

Posted By :nishithraj     Posted Date :December 28, 2009    Points :10   Category :WPF 
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 user control that contains the ActiveX control and then simply host the user control in the WindowsFormsHost control.

You can also find related Interview Question to Can I use user controls and third-party controls including ActiveX controls in WPF?  below: 

What are user controls?

  
User controls are custom, reusable controls, and they use the same techniques that are employed by HTML and Web server controls. They offer an easy way to partition and reuse common user interfaces across ASP.NET Web applications. They use the same Web Forms programming model on which a Web Forms page works (More...)

What are the differences between user and custom controls?

  
User controls are easier to create in comparison to custom controls, however user controls can be less convenient to use in advanced scenarios.
User controls have limited support for consumers who use a visual design tool whereas custom controls have full visual design tool support for consumers.
A separate copy of the user control is required in each application that uses it whereas only a single copy of the custom control is required, in the global assembly cache, which makes maintenance easier.
A user control cannot be added to the Toolbox in Visual Studio whereas custom controls can be added to the Toolbox in Visual Studio.
User controls are good for static layout whereas custom controls are good for dynamic layout.
(More...)

Define User Controls Class?

  
User Controls are created by the user and are based on the class UserControl (System.Windows.Forms.UserControl). User controls too have properties, methods and events. (More...)

What is the difference between custom controls and user controls

  
Custom controls are basically compiled code i.e. DLLs. These can be easily added to toolbox, so it can be easily used across multiple projects using drag and drop approach. These controls are comparatively hard to create.

But User Controls (.ascx) are just like pages (.aspx). These are comparatively easy to create but tightly couple with respect to User Interface and code. In order to use across multiple projects, we need to copy and paste to the other project as well. (More...)

What are server controls?

  
ASP.NET server controls are components that run on the server and encapsulate user-interface and other related functionality. They are used in ASP.NET pages and in ASP.NET code-behind classes. (More...)

What is the difference between login controls and Forms authentication?

  
Login controls are an easy way to implement Forms authentication without having to write any code. For example, the Login control performs the same functions you would normally perform when using the FormsAuthentication class—prompt for user credentials, validate them, and issue the authentication ticket—but with all the functionality wrapped in a control that you can just drag from the Toolbox in Visual Studio. Under the covers, the login control uses the FormsAuthentication class (for example, to issue the authentication ticket) and ASP.NET membership (to validate the user credentials). Naturally, you can still use Forms authentication yourself, and applications you have that currently use it will continue to run. (More...)

How many types of validation controls are provided by ASP.NET ?

  
There are six main types of validation controls:-

RequiredFieldValidator: It checks whether the control have any value. It's used when you want the control should not be empty.

RangeValidator: It checks if the value in validated control is in that specific range.

CompareValidator: It checks that the value in controls should match the value in other control.

RegularExpressionValidator: When we want the control value should match with a specific regular expression.

CustomValidator: It is used to define UserDefined validation.

ValidationSummary: It displays summary of all current validation errors. (More...)

Where is image data loaded into ImageList controls actually stored in the project?

  
Each form has an associated resource file (with a .resx extension) where image data and localized strings are stored.You can see this by clicking the Show All Files icon in the Solution Explorer. (More...)

Does ViewState is responsible for maintaining data across the Page Post Back for Postback controls (like textbox, dropdownlist) and non-postbackcontrols(like label)?

  
It is false. For NonPostback controls it is true but for postback controls, ASP.NET retrieves their values one by one from the HTTP request and copies them to the control values while creating the HTTP response. (More...)

What is the difference between login controls and Forms authentication?

  
Forms authentication can be easily implemented using login controls without writing any code.
Login control performs functions like prompting for user credentials, validating them and issuing authentication just as the FormsAuthentication class.
However, all that's needs to be dne is to drag and drop the use control from the tool box to have these checks performed implicitly.
The FormsAuthentication class is used in the background for the authentication ticket and ASP.NET membership is used to validate the user credentials. (More...)

Name the navigation controls of ASP.NET ?

  
1)Dynamic menus
2)TreeViews
3)Site Map Path (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend