Home
Winforms
Interview FAQs

FAQs of level

Intermediate

Use the static Process.GetProcesses() found in the System.Diagnostics namespace.

Using System.Diagnostics;
...
foreach ( Process p in Process.GetProcesses() )
Console.WriteLine( p ); // string s = p.ToString();

Yes, you can. Then the class belongs to global namespace which has no name. For commercial products, naturally, you would not want global namespace.
You can prevent the beep when the enter key is pressed in a TextBox by deriving the TextBox and overriding OnKeyPress -

public class CustomTextBox : TextBox {
protected override void OnKeyPress( KeyPressEventArgs e )
{
if ( e.KeyChar == (char) 13 )
e.Handled = true;
else
base.OnKeyPress( e );
} }

The PerformClick() method of the Button class is used to generate the Click event of the System.Windows.Forms.Control class.
The Debug.Write call will not be compiled when the DEBUGsymbol is not defined (when doing a release build). Trace.Write calls will be compiled. Debug.Write is for information you want only in debug builds, Trace.Write is for when you want it in release build as well.

A pixel is the lowest-resolution dot the computer monitor supports. Its size depends on users settings and monitor size. 

A point is always 1/72 of an inch.

An em is the number of pixels that it takes to display the letter M.

Providing a border in the non-client region of your control rather than in the ClientRectangle has very many advantages: 

  • When you include a scrollbar in your control, the scrollbar will appear inside the border, rather than to the outside if you drew the border in the client area. 
  • When you allow custom painting of the control, your user will not draw over the NC border. 
  • Your own client painting code will be simplified in that you will not have to bother about taking the border into account while painting the client area.

The user always downloads the latest version of the code, the program runs within security sandbox, properly written app will not require additional security privileges.

 The Opacity Property of a control determines the Transparency level of the control.
Displaying 1 of 2Next
1 2
Need Help? Contact Us.

Log in

*
*

Forgot password?

*

New User

*
*
*
*