[quote=marcosalex][quote=SilentSierra]
Assim como Java, existe o .Net, a vantagem de trabalhar com .Net hoje é maior do que a de trabalhar com Java, visto que um framework apenas supri 3 linguagens distintas VB, C# e C++ em apenas uma IDE (Visual Studio), além de vir com editor pra CSS, JavaScript, AJAX, X/HTML, ASP, SQL Server, entre outras bugingangas mais da Microsoft…
[/quote]
Ué, o Eclipse e o Netbeans tem suporte a muito mais de 3 linguagens distintas em uma mesma IDE. Aliás, o RAD Studio da Embarcadero (ex Borland) também. Aliás, uma pensa de outras IDEs também.
[/quote]
Framework é a biblioteca de componentes, quando digo que o .Net permite trabalhar com 3 linguagens, é que você pode usar os mesmos componente, da mesma forma… e IDE é o ambiente de desenvolvimento.
Exemplo retirado do Help (muito bem organizado por sinal) do Visual Studio, com o componente “System.Windows.Forms” e como pode ser usado:
Visual Basic
[code]Public Sub CreateMyForm()
’ Create a new instance of the form.
Dim form1 As New Form()
’ Create two buttons to use as the accept and cancel buttons.
Dim button1 As New Button()
Dim button2 As New Button()
' Set the text of button1 to "OK".
button1.Text = "OK"
' Set the position of the button on the form.
button1.Location = New Point(10, 10)
' Set the text of button2 to "Cancel".
button2.Text = "Cancel"
' Set the position of the button based on the location of button1.
button2.Location = _
New Point(button1.Left, button1.Height + button1.Top + 10)
' Set the caption bar text of the form.
form1.Text = "My Dialog Box"
' Display a help button on the form.
form1.HelpButton = True
' Define the border style of the form to a dialog box.
form1.FormBorderStyle = FormBorderStyle.FixedDialog
' Set the MaximizeBox to false to remove the maximize box.
form1.MaximizeBox = False
' Set the MinimizeBox to false to remove the minimize box.
form1.MinimizeBox = False
' Set the accept button of the form to button1.
form1.AcceptButton = button1
' Set the cancel button of the form to button2.
form1.CancelButton = button2
' Set the start position of the form to the center of the screen.
form1.StartPosition = FormStartPosition.CenterScreen
' Add button1 to the form.
form1.Controls.Add(button1)
' Add button2 to the form.
form1.Controls.Add(button2)
' Display the form as a modal dialog box.
form1.ShowDialog()
End Sub[/code]
C#
[code]public void CreateMyForm()
{
// Create a new instance of the form.
Form form1 = new Form();
// Create two buttons to use as the accept and cancel buttons.
Button button1 = new Button ();
Button button2 = new Button ();
// Set the text of button1 to “OK”.
button1.Text = “OK”;
// Set the position of the button on the form.
button1.Location = new Point (10, 10);
// Set the text of button2 to “Cancel”.
button2.Text = “Cancel”;
// Set the position of the button based on the location of button1.
button2.Location
= new Point (button1.Left, button1.Height + button1.Top + 10);
// Set the caption bar text of the form.
form1.Text = “My Dialog Box”;
// Display a help button on the form.
form1.HelpButton = true;
// Define the border style of the form to a dialog box.
form1.FormBorderStyle = FormBorderStyle.FixedDialog;
// Set the MaximizeBox to false to remove the maximize box.
form1.MaximizeBox = false;
// Set the MinimizeBox to false to remove the minimize box.
form1.MinimizeBox = false;
// Set the accept button of the form to button1.
form1.AcceptButton = button1;
// Set the cancel button of the form to button2.
form1.CancelButton = button2;
// Set the start position of the form to the center of the screen.
form1.StartPosition = FormStartPosition.CenterScreen;
// Add button1 to the form.
form1.Controls.Add(button1);
// Add button2 to the form.
form1.Controls.Add(button2);
// Display the form as a modal dialog box.
form1.ShowDialog();
}[/code]
C++
[code]public:
void CreateMyForm()
{
// Create a new instance of the form.
Form^ form1 = gcnew Form;
// Create two buttons to use as the accept and cancel buttons.
Button^ button1 = gcnew Button;
Button^ button2 = gcnew Button;
// Set the text of button1 to "OK".
button1->Text = "OK";
// Set the position of the button on the form.
button1->Location = Point(10,10);
// Set the text of button2 to "Cancel".
button2->Text = "Cancel";
// Set the position of the button based on the location of button1.
button2->Location =
Point( button1->Left, button1->Height + button1->Top + 10 );
// Set the caption bar text of the form.
form1->Text = "My Dialog Box";
// Display a help button on the form.
form1->HelpButton = true;
// Define the border style of the form to a dialog box.
form1->FormBorderStyle = ::FormBorderStyle::FixedDialog;
// Set the MaximizeBox to false to remove the maximize box.
form1->MaximizeBox = false;
// Set the MinimizeBox to false to remove the minimize box.
form1->MinimizeBox = false;
// Set the accept button of the form to button1.
form1->AcceptButton = button1;
// Set the cancel button of the form to button2.
form1->CancelButton = button2;
// Set the start position of the form to the center of the screen.
form1->StartPosition = FormStartPosition::CenterScreen;
// Add button1 to the form.
form1->Controls->Add( button1 );
// Add button2 to the form.
form1->Controls->Add( button2 );
// Display the form as a modal dialog box.
form1->ShowDialog();
}[/code]
J#, uma versão Java da Microsoft…
[code]public void CreateMyForm()
{
// Create a new instance of the form.
Form form1 = new Form();
// Create two buttons to use as the accept and cancel buttons.
Button button1 = new Button();
Button button2 = new Button();
// Set the text of button1 to "OK".
button1.set_Text("OK");
// Set the position of the button on the form.
button1.set_Location(new Point(10, 10));
// Set the text of button2 to "Cancel".
button2.set_Text("Cancel");
// Set the position of the button based on the location of button1.
button2.set_Location(new Point(button1.get_Left(),
button1.get_Height() + button1.get_Top() + 10));
// Set the caption bar text of the form.
form1.set_Text("My Dialog Box");
// Display a help button on the form.
form1.set_HelpButton(true);
// Define the border style of the form to a dialog box.
form1.set_FormBorderStyle(get_FormBorderStyle().FixedDialog);
// Set the MaximizeBox to false to remove the maximize box.
form1.set_MaximizeBox(false);
// Set the MinimizeBox to false to remove the minimize box.
form1.set_MinimizeBox(false);
// Set the accept button of the form to button1.
form1.set_AcceptButton(button1);
// Set the cancel button of the form to button2.
form1.set_CancelButton(button2);
// Set the start position of the form to the center of the screen.
form1.set_StartPosition(FormStartPosition.CenterScreen);
// Add button1 to the form.
form1.get_Controls().Add(button1);
// Add button2 to the form.
form1.get_Controls().Add(button2);
// Display the form as a modal dialog box.
form1.ShowDialog();
} //CreateMyForm[/code]