.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 >> C# >> Post New Question Subscribe to Interview Questions

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

Posted By :nishithraj     Posted Date :November 30, 2009    Points :10   Category :C# 
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.

You can also find related Interview Question to Why does my Windows application pop up a console window every time I run it?  below: 

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 Windows And Console Application?

  
http://www.dotnetspark.com/Forum/42-diff-bw-console-application-and-windows.aspx (More...)

You are designing a GUI application with a window and several widgets on it. The user then resizes the app window and sees a lot of grey space, while the widgets stay in place. What's the problem?

  
One should use anchoring for correct resizing. Otherwise the default property of a widget on a form is top-left, so it stays at the same location when resized. (More...)

Are the actual permissions for the application defined at run-time or compile-time?

  
The CLR computes actual permissions at runtime based on code group membership and the calling chain of the code. (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...)

Real software is developing a speech-based user interface for blind people. However, speech based interface are difficult to design and time given by the client is short. To develop a functional interface without any errors, the company wants to first evaluate the prototype. They used the storyboard technique to demonstrate the functionality of the application. However, this technique was unable to demonstrate the interactive feature of the application. Analyze and provide solution for the above scenario?

  
1, The design team of Real software should have used the Sketching technique because storyboard technique would only provide the flow and features of the interface.

2, The design team of Real software should have used the Horizontal Prototyping because storyboard technique would only provide the flow of the interface.

3, The design team of Real software should have used the Wizard of Oz technique because storyboard technique would only provide the flow and features of the interface

4, The design team of Real software should have used the Vertical Prototyping because storyboard technique would only provide the flow of the interface.


Answer : 3 (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...)

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