Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I would like to set every time i run my program values for 3 variables(for example x-y-z_ from keyboard.I know how to do it at console application but i am a little confused with win form because i use it for a first time.Could someone give me some help?






Thank you

What I have tried:

I haven't find anything helpful.
Posted
Updated 10-May-16 13:40pm
Comments
Patrice T 10-May-16 19:33pm    
Done something ?

1 solution

Well, if you've never set up a Windows Form for the first time, I'm sure there are better tutorials out there, because unless you do find one, this may as well be Greek (no offence to my Greek friends)

In Essence, if you can get the form in 'design' view/mode in front of you, you

a) drag a label from the tools pallette onto the form
b) change the label to (for example) 'X'
c) drag a textbox onto the form to the right of the label
d) change the textbox name to (for example) value_x

e) repeat a-d for 'Y' & 'Z' and value_y, value_z, aligning the labels/textboxes as you see fit
f) drag a button from the tools palette onto the textbox
g) add an event to the button - lets call it button1_click
h) in the button1_click handler, you read the value of the textboxes, ie

C#
string xText = value_x.Text;
string yText = value_y.Text;
string zText = value_z.Text;


i...) convert the xText... values to integer etc and use them

as I said, you need to find some tutorials .. these links 'may' help

Step 1: Create a Windows Forms Application Project[^]

Getting Started with Windows Forms using Visual C# | Holowczak.com[^]
 
Share this answer
 
v3
Comments
Member 12181090 11-May-16 10:05am    
I am Greek too!!;p
I understand everything that you told me.Thank you very much for your time it works fine!
I am young and i have only work with console application at Visual Studio so i am still learning.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900