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


Top 5 Contributors of the Month
ASPEvil
Ashutosh Jha
Jean Paul
satyapriyanayak
SP

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

Differences between Windows And Console Application?

Posted By :Mallikarjuna Chigicherla     Posted Date :August 12, 2010    Points :10   Category :.NET Framework 
http://www.dotnetspark.com/Forum/42-diff-bw-console-application-and-windows.aspx

You can also find related Interview Question to Differences between Windows And Console Application?  below: 

Why does my Windows application pop up a console window every time I run it?

  
Make sure that the target type set in the project properties setting is set to Windows Application, and not Console Application. If you're using the command line, compile with /target:winexe, not /target:exe. (More...)

Different between console application and windows application?

  
The windows application is graphical user interface(GUI),console application is character user interface(CUI). (More...)

Differences between application and session.

  
The session object maintains state on a per client basis whereas the application object is on a per application basis and is consistent across all client requests. (More...)

Can I use Windows Forms in a WPF application?

  
Yes you can. You can have a WPF application pop a Windows Form much in the same way that you can pop a WPF window from a Windows Forms application. Furthermore, you can place Windows Forms controls side-by-side with WPF controls on a WPF window or page by using the WindowsFormsHost control that will ship as part of the interoperability layer. (More...)

How do I host a WPF control in a Windows Forms application?

  
add references to the WPF namespaces (PresentationCore, PresentationFramework, UIAutomationProvider, UIAutomationTypes, and WindowsBase). Next create an instance of the ElementHost control and the control you wish to embed in the Windows Forms application and then hook that control up to the ElementHost control. Then simply add the ElementHost control to your Forms control collection:

ElementHost host = new ElementHost();

System.Windows.Controls.ListBox wpfListBox = new System.Windows.Controls.ListBox();

for (int i = 0; i < 10; i++)

{

wpfListBox.Items.Add("Item " + i.ToString());

}

host.Dock = DockStyle.Fill;

host.Controls.Add(wpfListBox);

this.panel1.Controls.Add(host);

However, if you want to use XAML to describe the WPF control that you want to use in the Windows Forms application, you would need to add an Avalon UserControl item to your project. This will create a UserControl1.xaml file and a UserControl1.xaml.cs file. You can then modify the UserControl1.xaml file to contain whatever XAML you wish to describe your control. Then you would simply create an instance of this control and add it to the ElementHost control as in the above example:

ElementHost host = new ElementHost();

UserControl1 uc1 = new UserControl1();

host.Controls.Add(uc1);

host.Dock = DockStyle.Fill;

this.panel1.Controls.Add(host);

In addition, you will need to modify the project file because the Windows Application does not what to do with the XAML file. You will need to open the project file (.csproj, .vbproj, etc.) in an editor like Notepad and then scroll to the bottom. You will see the following line:



You will need to copy this line and paste it just below the above line and then change "CSharp" to "WinFX" so that the two lines look like:





Now save this file and reload the project using VS and run the application. (More...)

Why do we have Databind function in Web application but not in Windows application?

  
DataGrid ListBox and HTML Select use a collection as a data source. For example listbox uses listitem as a child control but in case of windows there is no list items. When you call DataBind on a parent control it cascades to all of the children of the control. so databind is needed in asp.net not in windows.

Similar is the case with other collection controls like Radio button list and Checkbox list etc (More...)

How to disable Cut,Copy and Paste in a Text Box Control C# Windows Application ??

  
On the text box enter event, please have the below code

System.Windows.Forms.Clipboard.Clear();

(More...)

Can you create non rectangular form?
How you create non rectangular form in windows application?

  
You can create the non rectangular form in windows application
It can be created by setting the region property of the form.The changes can not be seen at design time but can be seen at run time.
Region is the instance of System.Drawing.Region class.
(More...)

What are the namespaces which needed to host a WPF control in Windows form application

  
The following namespaces needs to be referenced :
a)PresentationCore.dll
b)PresentationFramework.dll
c)UIAutomationProvider.dll
d)UIAutomationTypes.dll
e)WindowsBase.dll
(More...)

What namespaces are needed to host a WPF control in Windows form application?

  
The following namespaces needs to be referenced :
a)PresentationCore.dll
b)PresentationFramework.dll
c)UIAutomationProvider.dll
d)UIAutomationTypes.dll
e)WindowsBase.dll

(More...)

What are the Types of Configuration files in Windows Application?

  
Application Configuration
Machine Configuration File
Security Configuration File
(More...)

How to call windows Form in WPF Application?

  
Create WPF Application in the VS 2008.
Create a Form in the WPF Application .
Create a Button Control in the WPF Application .
Copy and Paste the following into Button Click Event:
From1 frm = new Form1();
frm.Show()
Note:User can call WPF Form to Windows Form and Windows Form to WPF Form. in WPF Application .
But , You can;t Create a WPF Form in the Windows Application. (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