473,326 Members | 2,108 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Simple .Net form?

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
Jul 21 '05 #1
2 1082
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()


Jul 21 '05 #2
Hello richlm

Thanks for the reply...will be studying it.
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: r0adhog | last post by:
I have a very simple form: <html> <head> </head> <body> <% function ValForm() if len(document.form.newapp.all("AccessCode").Value) = 4 then document.form.newapp.submit()
7
by: Houston | last post by:
I have a form that after being filled out has its contents written to a database and then goes to confirmation .asp page. I want the confirmation page to be personalized but I am not sure how to...
2
by: SU_Oran | last post by:
I found this when searching. I need to have a simple script that will upload a single file. It is giving me an error on Set upl = Server.CreateObject("ASPSimpleUpload.Upload") It is saying : ...
6
by: francisco lopez | last post by:
ok , first of all sorry if my english is not so good, I do my best. here is my problem: I don´t know much javascript so I wrote a very simple one to validate a form I have on my webpage. ...
0
by: Tal Sharfi | last post by:
Hi everyone I recently had the need for StringGrid object same as the one that Delphi has. An object that helps show lists of other objects in a simple grid. I searched the news groups and...
1
by: James Alba | last post by:
Hi again all, I was wondering if there was a simple built in dialog box that contained only a textbox and an ok button? Just like the MessageBox.Show(...) class/method. Or do I have to make...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
4
by: Duncan | last post by:
Hi I'm learning c# 2.0 as I feel I need to be able to switch between vb & c#, I'm just starting with a few simple examples and I've come across a problem. I've got two forms ones an MDI parent &...
5
by: Byron | last post by:
I need to create an application that uses primarily a single form rather than an SDI that creates a new form for everythting. However, I don't want an MDI style application since the users I'm...
24
by: firstcustomer | last post by:
Hi, Firstly, I know NOTHING about Javascript I'm afraid, so I'm hoping that someone will be able to point me to a ready-made solution to my problem! A friend of mine (honest!) is wanting to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.