Simple .Net form?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all

I'm trying to venture into the world of .NET and I think the lanquage I'd like to use is Managed C++
I've tried going through the tutorials/examples, but just haven't found what I'm looking for. What I'd like to do
is have a simple Manged C++ form with a listbox and a cancel button. When the app is started, it would jus
enter into the listbox whatever was on the command line, the cancel button would cause the app to exit after poppin
up a message box, saying the app is ending. Coming from a MFC background, this wouldn't be all that difficult
however, it seems in .NET I can't even figure out how to populate a string or pop up a message box!!
Any help, examples or sites to visit, to get me going, would be appreciated...

TIA

Ray K
 
My advice to you (as an ex C++ programmer) is to take the effort needed to get to grips with C# and .NET framework
You will find you need to write considerably fewer lines of code

Here's an example of what you want to do in C#
Create it as a C# console app & you will need to add a reference to System.Windows.Forms

using System
using System.Windows.Forms

namespace ConsoleApplication

class Class

[STAThread
static void Main(string[] args

Form f = new Form()
ListBox lb = new ListBox()
Button b = new Button()

f.Controls.Add(lb)
f.Controls.Add(b)

b.Top = lb.Height
b.Text = "Cancel"
b.Click += new System.EventHandler(button1_Click)

foreach (string s in args
lb.Items.Add(s)
Application.Run(f)


static void button1_Click(object sender, System.EventArgs e

MessageBox.Show("the app is ending")
Application.Exit()
 
Back
Top