Use of this code? Where can we use this?

Posted by Sridevi under C# on 4/19/2012 | Points: 10 | Views : 893 | Status : [Member] | Replies : 5
Could anyone explain what is the purpose of this code?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
static class Program
{

[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}



Regards,
Sridevi.

Sridevi


Responses

Posted by: Leila on: 4/19/2012 [Member] Starter | Points: 25

Up
0
Down
Main is the first function that executes when running the application.
It is used in Windows forms application

Thanks,
Leila

Sridevi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/19/2012 [Member] Silver | Points: 25

Up
0
Down
Application.EnableVisualStyles();
//Enables visual styles for the application.



Regards,
Singaravel M

Sridevi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/19/2012 [Member] Silver | Points: 25

Up
0
Down
i think u got file from..

http://msdn.microsoft.com/en-us/library/system.windows.forms.application.setcompatibletextrenderingdefault.aspx

Regards,
Singaravel M

Sridevi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/19/2012 [Member] Silver | Points: 25

Up
0
Down
Refer this for Application.SetCompatibleTextRenderingDefault(false);....

http://blogs.msdn.com/b/jfoscoding/archive/2005/10/13/480632.aspx

Regards,
Singaravel M

Sridevi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Dotnetrajanikanth on: 4/19/2012 [Member] Starter | Points: 25

Up
0
Down
Sridevi,

Actually there is a difference between text rendering in .net framework 1.X and version 2.x and above. this is mainly used to make the text rendering uniform in both the frame works. 1.x uses graphic class to render the text and 2.x and above uses text rendering class so this makes both compatible and helps to view the text as same in 1.x and 2.x above versions.

____________
www.flickr.com/photos/psdesigner/

Sridevi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response