Simple application Help, please

A

Ali

Hello everyone,

I'm trying to do something simple, like making a form with 1 textBox + 1
Button + 1 Lable

making the user enter a name in the textBox and when the Button clicked..
the Lable shows the name.

tried many ways, and I know it's something I'm blindly passing.

Thanks for the answers in advance.
 
P

Peter Duniho

Ali said:
Hello everyone,

I'm trying to do something simple, like making a form with 1 textBox + 1
Button + 1 Lable

Create a new project, using the "Windows Forms Application" template.

Use the Designer to drag onto the form your TextBox, Button, and Label.
making the user enter a name in the textBox and when the Button
clicked.. the Lable shows the name.

In the Designer, double-click on the Button. This will insert a method
stub into your Form sub-class, and automatically subscribe the method as
the event handler for the Button's Click event.

In that method, include this line of code:

label1.Text = textBox1.Text;

(where "label1" and "textBox1" are the field names for your Label and
TextBox controls, respectively...the names I've given above are the
defaults).
tried many ways, and I know it's something I'm blindly passing.

In general, if you have tried some way and it doesn't work, it is
helpful to actually describe what you _have_ tried, so that people are
better able to understand what you've done wrong and what advice you need.

If the above does not help you, you need to provide better details in
your question, including posting the code that doesn't work/doesn't do
what you want it to.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top