By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,333 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,333 IT Pros & Developers. It's quick & easy.

Hello world, I need a "hello world"

Expert 5K+
P: 8,434
Hi all.

I'm wondering whether the Bytes community can help me out a little.

As some of you know, I've worked with VB6 (and earlier versions) for many years, and enjoy answering questions in the VB6 forum when possible.

Sometime last year I installed Visual Studio 2012 and have been planning to learn VB.Net.

I did eventually get around to giving it a shot. Ugh! what a disaster. After hours of wracking my brain, I gave up trying to create even the simplest program. Seriously, I couldn't work out how to achieve the most basic, fundamental task in my code such as showing a form or setting a control property.

Since then, many months have gone by. I've been too busy, too lazy, and if I'm honest with myself, probably too intimidated to really try again. I realise VB.Net has all sorts of things going for it, and that there are good reasons for the major changes. But that doesn't change the fact that there's a very steep early learning curve in going from one to the other. This is made worse by a couple of factors:
  • First, the VB6 conversion tool provided with earlier .Net versions has been removed. Thanks a ton, MS. Otherwise I'd convert one of my old programs and go from there.
  • Second, the upgrade-related information I've been able to find seems entirely interested in the differences between the prior version and 2012 - not terribly helpful.
Now I have finally got hold of a very helpful-sounding book on VB6 to VB.Net upgrade, and started making my way through it. It's in PDF form, and I'm not sure of the actual name of the book, or the authors. Plus, it was written in the early .Net days so will undoubtedly leave me with quite a bit of version-specific stuff to pick up. I can live with that. I've always been a dabbler and fiddler in the programming world, and will pick up the rest - if I can just get started! So far it's just teaching me why .Net is better, why MS decided to make the break with ActiveX, philosophical differences between ActiveX and the .Net framework, and so on. And on. And on. Interesting enough if I had the time, but pretty slow going.

So here's what I'd like to ask.

Could someone here please throw together in VB.Net (latest version you have handy) a very simple "hello world" application and post it here, so I can load into VB2012 as a starting point to play with. It doesn't need to have comments, or demonstrate or explain anything. Just a simple form, with say a text box, and a button which will copy the text box contents to a label. The sort of thing I could slap together in about 30 seconds in VB6, and I assume it's just about as simple in .Net if you know what you're doing. With that as a starting point, I'll have great fun picking apart how it works and teaching myself the rest.

In fact, perhaps it could be attached to an article in the appropriate section, for the benefit of others trying to make the leap.
Jul 18 '13 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 10K+
P: 12,382
This is what I did in VS2008.
  1. Created a Windows Forms Application project.
  2. Dragged a button and label to the form.
  3. Put the following in the code.
Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.     Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
  3.         Label1.Text = "Hello World!"
  4.     End Sub
  5. End Class
Jul 18 '13 #2

Expert 5K+
P: 8,434
Thanks for that, Rabbit. I'll go have a play agin.

As far as I can recall (it's been a while) some of the biggest problems I had were in trying to do things like showing another form or changing visibility of controls. Anyway, like I said I'll spend some time playing with it again.
Jul 19 '13 #3

Post your reply

Sign in to post your reply or Sign up for a free account.