Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new to .net and VB simple question

Status
Not open for further replies.

madcgimonk

Programmer
Oct 8, 2004
25
US
This is my first ever VB program and it's in .net. I have a textbox called box1 and a single submit button. I want to store the data from the textbox in a variable and then print it to screen.

What did I do wrong?
Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim strBox As Long
        strBox = box1.Text
        Print(strBox)
        End
    End Sub
 
Print(strBox)
End

print(strbox) is not something you would generaly use in vb.net and end will close your form so what ever you did in you button click you won't see much of it because the form would close real fast.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Depends if you are using a consoleapplication then do

console.writeline(strbox)




Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
I'm thinking this isn't a very friendly language. I've been programming in other languages before and there shouldn't be more than one way to print.

Thanks for your help. Now I have to decide if I still want to go VB or try Delphi instead.
 
I'm thinking this isn't a very friendly language. I've been programming in other languages before and there shouldn't be more than one way to print.

Actually, VB.NET is very easy -- it's just an extension of VB6, after all.

What's hard is learning the .NET framework. There is a lot of functionality in it, and the majority of the time that anyone spends in learning the tools is spent learning it.

What you have to do is sit down with a couple of good books and work your way through it. It's a gradual process that you'll have to do whether you choose Delphi or VB.NET.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Where about on the screen do u want to print the information. on the form or On the button or a Message box


Here is a msgbox example


Dim TmpStr As String
TmpStr = TextBox1.Text
MessageBox.Show(TextBox1.Text.ToString())
 
On 10/24 chiph suggested that madcgimonk sit down with a couple of good VB.Net books to get a feel for the language.

I'm BRAND NEW to VB and will be working with VB.Net.

Does anyone have suggestions for "good books" on the subject. Or better yet, since I am so new, can anyone suggest any good web sites to get me started.

Thanks in advance for your suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top