I am trying to design a Windows Form Application in VisualStudio which has text input boxes so that users can input data and have the application perform actions to that dtat, then display the results. So far I have done the obvious part of designing the application in the designer, but I am stuck, because I don't know how to retrieve the data from the text boxes to perform actions. I have been searching Google for a long time, and the closest thing I can find is the "get" ...command(?)... for retrieving information and displaying it in a pop-up dialog box. I found it here:
http://msdn.microsof...4(v=VS.71).aspx
Here's what I am trying to do, specifically: The application has multiple text boxes for inputting measurements of circles, either the circumference, radius, diameter, etc. It also has a GO button and a results box. The user enters what information they have - the circumference for example - and hits the GO button. The application takes that, applies math to it, and returns all the other data (radius, diameter, inches and cm to 90* etc).
I can find tutorials on how to make the GO button work, pretty easily, but without the ability to get the user's data, it's useless. I also can't can't find any tutorials on how to make the data print to a results box, rather than a separate dialog pop-up box.
Ideas?
So after I posted this RFI, I get a list of related posts below, and one of them is a tutorial for a calculator program. I am going to check this out, and hopefully I can glean enough information to apply it to a Windows Form Application.
I would still appreciate information from the masses.
5 Replies - 1949 Views - Last Post: 01 January 2012 - 10:25 AM
#1
Fetching/"Get"ting Data From Text Boxes in VisualStudio Using
Posted 01 January 2012 - 08:47 AM
Replies To: Fetching/"Get"ting Data From Text Boxes in VisualStudio Using
#2
Re: Fetching/"Get"ting Data From Text Boxes in VisualStudio Using
Posted 01 January 2012 - 08:50 AM
icyfyer, on 01 January 2012 - 09:47 AM, said:
I am stuck, because I don't know how to retrieve the data from the text boxes
You have to access .Text property for each textbox.
It sounds like you simply installed Visual Studio then started mucking about with it. That's just not going to get you anywhere. You really need to pick up a book or do some on-line tutorials.
Let me say this though... It sounds like this is all VERY new to you. This type of thing is covered very early on in any self-teaching book. Which makes me think you really aren't ready to be designing an application yet.
Newbie/Rookie said:
I have a little programming experience but I need to write ...
You need to start there. I can't say "I have little experience in speaking Russian, but I have been assigned to write a mystery novel in Russian. Can you help me?"
We can help you by saying "First learn basic programming and the language of C#. Then take on assignments." Could someone here write this program for you? Sure. Could someone here map out all the processes you need to follow and do the Software Design part of this in the slim hope you could code it from there? Sure. But we don't volunteer to do the job that you're either getting paid for, or getting a grade for. You may want to read this.
For now, just work on the lessons. Do a self-teaching book from cover to cover. Then consider writing a program.
Don't try to create a useful working program to fit a need of yours (or a for-pay contract) as your introduction to coding project. When you are learning to code you don't know enough to code a program, let alone know how to engineer the architecture of a program. It would be like saying "I don't know how to read sheet music, or play an instrument. I think I'll write a 3 act opera as my first learning experience."
I don't say this to be mean. We've seen lots of new coders take this approach and we know it doesn't work. Trying to design your own programs before you understand the basics of the code language you've chosen just leads to problems, frustrations, and 'swiss-cheese' education (lots of holes).
Resources, references and suggestions for new programmers. - Updated Dec 2011
Spoiler
#3
Re: Fetching/"Get"ting Data From Text Boxes in VisualStudio Using
Posted 01 January 2012 - 09:09 AM
I understand your point, and appreciate your honsety, but must say that you underestimate the value of language immersion as a method of learning. I am currently working my way through 3 C# books, but they take an approach that they assume most people will be following in order to learn the language. The books I have are:
-C# in a Nutshell 4.0
-The C# Programming Language (4th Edition)
-Head First C#: Second Edition
I've gone through the first 3 chapters of the Head First book, and have learned how it works (it's written in a casual tone), but it addresses the language in an order that seems backward to me, past the first chapter. By the way, the book's authors understand my intent with immersion, as the first chapter makes one create a database application right from the start. The problem is that it doesn't go in my desired order of: Do this, do that, this is why. Instead, it goes through chapters of: this is a wrench and it can be used for this and that, and comes in these colors, but I won't show you how to use it yet. The other books are way too technical for the beginner. Specifically, the Nutshell is more of a reference guide than a learning manual.
I don't expect anyone to actually write the program for me; I never asked to have it written. All I need, instead of a lecture on "pick up a book" was exactly what you provided in one line: an IDEA. Now that you have told me I need to "access .Text property for each text box" I can go to the internet and ask it for assistance.
Lastly, this is not an assignment, or an attempt to create a commercial product. This application is a side project because trying to learn a language without a use for it is like masturbation. You wouldn't learn Russian if you weren't ever going to speak it, would you?
-C# in a Nutshell 4.0
-The C# Programming Language (4th Edition)
-Head First C#: Second Edition
I've gone through the first 3 chapters of the Head First book, and have learned how it works (it's written in a casual tone), but it addresses the language in an order that seems backward to me, past the first chapter. By the way, the book's authors understand my intent with immersion, as the first chapter makes one create a database application right from the start. The problem is that it doesn't go in my desired order of: Do this, do that, this is why. Instead, it goes through chapters of: this is a wrench and it can be used for this and that, and comes in these colors, but I won't show you how to use it yet. The other books are way too technical for the beginner. Specifically, the Nutshell is more of a reference guide than a learning manual.
I don't expect anyone to actually write the program for me; I never asked to have it written. All I need, instead of a lecture on "pick up a book" was exactly what you provided in one line: an IDEA. Now that you have told me I need to "access .Text property for each text box" I can go to the internet and ask it for assistance.
Lastly, this is not an assignment, or an attempt to create a commercial product. This application is a side project because trying to learn a language without a use for it is like masturbation. You wouldn't learn Russian if you weren't ever going to speak it, would you?
#4
Re: Fetching/"Get"ting Data From Text Boxes in VisualStudio Using
Posted 01 January 2012 - 09:45 AM
You don't need to search the internet for that, he already told you what you need to do.
It's as simple as this:
You store the text of a textBox to a string...
Also, I think you misunderstood the post above...
Do you have experience with some other OO languages? If you do then the way trial & error is kindda OK (well not really, but it can serve as a last resort), if you don't then don't learn from three books at once. Take one good book and go through it from cover to cover carefully... You might want to take that step-by-step approach even further, get a book just on OOP concepts and read it, then learn a language (that's how I learned to code)
It's as simple as this:
string text = textBoxName.Text;
You store the text of a textBox to a string...
Also, I think you misunderstood the post above...
Do you have experience with some other OO languages? If you do then the way trial & error is kindda OK (well not really, but it can serve as a last resort), if you don't then don't learn from three books at once. Take one good book and go through it from cover to cover carefully... You might want to take that step-by-step approach even further, get a book just on OOP concepts and read it, then learn a language (that's how I learned to code)
This post has been edited by RexGrammer: 01 January 2012 - 09:46 AM
#5
Re: Fetching/"Get"ting Data From Text Boxes in VisualStudio Using
Posted 01 January 2012 - 10:14 AM
icyfyer, on 01 January 2012 - 10:09 AM, said:
I understand your point, and appreciate your honsety, but must say that you underestimate the value of language immersion as a method of learning.
"Language Emersion" is fine for spoken languages because you already have a reference. You speak some language already. You already have an understanding of the concepts: syntax, grammar, conjugation and so on. Now you just have to learn the differences between your native language and the new one.
English: Chair Russian: stol
So let's take your statement and apply it here: Do you already have a complete understanding of another .NET language? Or another OOP lanaguge? VB.NET, Objective-C ??
icyfyer, on 01 January 2012 - 10:09 AM, said:
but they take an approach that they assume most people will be following in order to learn the language.
There is a reason these tutorial books are written in the way and order they are. Its because it works. Your 4th grade English class worked in a given order for the same reason. You had to learn the basic stuff to build a solid foundation, then add to that knowledge base with new and more advanced concepts. If you want to take the spoken language example then take it. You can't choose to take the parts you like and ignore the underlying principals of the educational process.
icyfyer, on 01 January 2012 - 10:09 AM, said:
I've gone through the first 3 chapters of the Head First book, and have learned how it works
No you haven't. You say you have already been through the first 3 chapters of one of them. Yet you have missed a very important principal/concept: That objects have properties. A textbox has a .Text property along with a couple dozen others.
icyfyer, on 01 January 2012 - 10:09 AM, said:
I don't expect anyone to actually write the program for me; I never asked to have it written. All I need, instead of a lecture on "pick up a book" was exactly what you provided in one line: an IDEA. Now that you have told me I need to "access .Text property for each text box" I can go to the internet and ask it for assistance.
You're welcome to learn however you like. But take it from the people that have done this for decades... the people that have answered thousands of questions on this forum... The people that have seen 1,000 other rookies just like you make the same arguement:
"I'm too smart to need to do it like the millions of other coders. I want to jump around and learn as I see fit even though I don't know enough about coding to even know the order I should learn in."
Keep in mind while you are jumping all over hell and gone... You're going to keep asking questions like this one... A question that would not need to be asked if you had just read through a couple chapters of a book... and its going to piss people off. You've already said that you only needed to read 3 chapters to understand how the language works. That's a pretty insulting and demeaning statement for those of use that do this for a living.
Nobody here is going to hand-hold you through the absolute basics of this, and that is what reading the .Text property of a textbox is. We are not your private tutors.
As the student you have to take some responsibility for your own education. You at least have to do the basic learning. You can't get all ADHD then expect the community to help you find what you want because you couldn't be bothered to do it the way millions of others did.
#6
Re: Fetching/"Get"ting Data From Text Boxes in VisualStudio Using
Posted 01 January 2012 - 10:25 AM
icyfyer, on 01 January 2012 - 10:09 AM, said:
I've gone through the first 3 chapters of the Head First book, and have learned how it works (it's written in a casual tone),
Then why did you have to ask this question? Because this is actually covered in Chapter 3.


So this really has nothing to do with advanced educational theory, language emermsion, the author being stupid, or anything else.
This is about YOU. You need to slow down. Put in the time and effort. Do all the work. Do all the projects. Stop thinking you can just speed-read your way through select sections in order to learn what you need to learn to build the application you want. It just doesn't work that way. Go back to my earlier post with the big resources list and invest your time and effort along the path that works and will give you the biggest pay-off for your effort.
This post has been edited by tlhIn`toq: 01 January 2012 - 10:25 AM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|