473,398 Members | 2,393 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,398 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 1087
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.