Writing Multiple Fields to one textbox [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Just need a little help with a program i have been working on. basically i work in a call centre and i am going to use this to record my notes during calls, i have everything worked out besides on feature. So i when filling out the fields i need it to show up in a specific textbox, and i need to structure this data to specific lines. I also want to try do this without having to store the data to txt file or a database, i want to try do it all within strings if possible. any help would be greatly appreciated guys.
thanks in advance

So in short.. you just created a button and some fields and have no idea how to proceed.. try selecting one programming language as #TheKingDave suggested. For example, if you go for C#..
try to read up on the below links to get yourself started:
system.windows.controls.textbox
system.windows.controls.combobox
but just, if I understand your question correctly, because let's face it, it's far from clear, you want to grab information you added into several textboxes and comboboxes etc and format them into one multiline textbox? If so...
Create a on_click event for your button in which you want to add stuff like..
string Example1 = this.mytextbox1.text;
string Example2 = this.mytextbox2.text;
string Example3 = this.mycombobox.SelectedItem;
...
afterwards you want to add all these strings together, for example
string MyResult = "Example1: " + Example1 + "\r\n" + "Example2" + ... ;
and then show this in your resulting textbox
this.myresulttextbox.text = MyResult;
Hope this answers your question somewhat but I strongly advise reading up on this before going any further..

What is actually your programming language?
Not sure about your question but if your goal is to concatenate everything into a single string, just read the text value from every *boxes you have and add them into the text value of your destination using a special joker character that is unused in your edited fields like 'ยค' for example to separate every string. It's easy then to process it later. The brutal way is to hard code every copy. A slightly more refined one would be to have a list of interesting components and for the copy to loop on them and according their type, chose the right access method to get the information.

Related

Generate C code using C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I've got this task that requires me to generate some basic C code using a software written in C#.
The generated code should be based on some input files I provide to my software, we'll call it btOS for easy of communication.
So when starting btOS I give it as input file1, config.xml. When I hit run it should output a file.c that contains some basic structures and/or methods based on what the input files contain.
Is there any elegant way to do this ? Maybe some already generated templates or methods or stuff like that ? The only way I could think of handling this was creating specific strings in C# and outputting them to a C file.
L.E.: It seems that somehow my question was not clear enough. I assume the fault of including C++ in the title, I have remove it but I don't see how that is relevant because the question was very simple.
Anyway, to make it more clear. All i need to do is read some config files (their content is irrelevant, all they contain are some variables that will be used to generate some function templates, which will mostly impact the name of the function) - and write an output file with the extension .C (as in Main.c) that will contain those templates I generated.
So, again, the question: Are there any "elegant" and maybe somehow "professional" ways to do this other than using custom generated strings within the code that I will write to the file ? Right now the only way I see fit to do this without too much hassle is using some template text files with a naming convention defined by me(e.g. function_variableName{...}) where I just change the [variableName] text with whatever I need to to be there and "Abracadabra" I have a function that I will write to the file.
Now as Soonts suggested please try and be helpful, read multiple times if you don't clearly understand or maybe even don't bother - let somebody who is interested in this topic, tries to help or gain some new knowledge before flagging it.
Double Cheers.

C# checking if a word is in an English dictionary? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am trying to go through a list of words and for each one determine if it is a valid English word (for Scrabble). I'm not sure how to approach this, do I have to go find a text file of all English words and then use file reading and parsing methods to manually build a data structure like a trie or hashmap - or can I find those premade somewhere? What is the simplest way to go about this?
You can use NetSpell library for checking this. It can be installed through Nuget Console easily with the following command
PM> Install-Package NetSpell
Then, loop through the words and check them using the library
NetSpell.SpellChecker.Dictionary.WordDictionary oDict = new NetSpell.SpellChecker.Dictionary.WordDictionary();
oDict.DictionaryFile = "en-US.dic";
oDict.Initialize();
string wordToCheck = "door";
NetSpell.SpellChecker.Spelling oSpell = new NetSpell.SpellChecker.Spelling();
oSpell.Dictionary = oDict;
if(!oSpell.TestWord(wordToCheck))
{
//Word does not exist in dictionary
...
}
Since you're looking specifically for valid Scrabble words, there are a few APIs that validate words for Scrabble. If you use anything that's not for that intended purpose then it's likely going to leave out some words that are valid.
Here's one, here's another, and here's a separate question that lists available APIs.
So that I can add some value beyond just pasting links, I'd recommend wrapping this in your own interface so that you can swap these out in case one or another is unavailable (since they're all free services.)
public interface IScrabbleWordValidator
{
bool IsValidScrabbleWord(string word);
}
Make sure your code only depends on that interface, and then write implementations of it that call whatever APIs you use.

C# Windows Form - access code [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to know where I can access the basic code, for example a "NumericUpDown" Element.
What I want to do:
Add Code to my NumericUpDown Element, for example:
Set the "Maximum"-Value to a variable embedded inside my Formclass code.
The Reason why I cant to it right now:
I just can access the NumericUpDown Element just in the Design View right now. There I can Input a value, but can't set it to the amount stored in a variable.
I just know, that If I double click the field, I get a "ValueChanged" Method into my code. But what I need to know: How can I access the "basic" Code of the NumericUpDown Element, where I could set the "Maximum"-Property?
I'm relatively new to programming. And I'm quite overwhelmed with a lot of things... So I COULD google for the problem but it would just take me way to much time.
Since I guess it's an easy answer for you guys, I post it here.
Thanks a lot!
You can access the Control's objects attributes by it's name.
For example:
NumericUpDown1 <- It's the name of your Control
In your C# code you can access all of it's attribtes and methods by puttin a period after it's name:
NumericUpDown1.Maximun = 100;
NumericUpDown1.Width = 250;
NumericUpDown1.Height = 10;
etc. You can serach it by "Control Properties" in google. Luck and effort! :P Remember to try and search a bit before asking. Don't wait for others to make your job. Luck! ^.^
You can access source code of components, but it won't help you. every component has interface and you can use it's interface to interact with it. Also you can override some methods of component to change their behavior.

Replace all string values with another within a project - C# [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
In my current project I want to implement a checkbox that, if checked, replaces all strings in labels, tabs, etc. currently being shown on a form with a different string.
For example, If checked, all instances of the word "car" would change to the word "truck" all through out the program.
I'd rather not go through a do a .replace on every single string in the code. I was wondering if there was some way to "intercept" output strings and replace them on the fly; something like making a string-listener. Any help would be appreciated!
I am no GUI/WinForms program but this would be my personal approach. Add all of these UI elements to a List<T> in the forms constructor. Then in the "replace box checked event handler" you can just iterate over the list applying the same change to all the items. It's by no means a perfect solution but it does mean you only have to statically reference each of the items once. After they're in the list you can operate on all of them very easily.

Creating an application for Math Practice with ASP.NET [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am trying a develop a Math Practice web application using ASP.NET (not MVC), which allows Users to perform Multiple choice or simply type an answer, click a button and see answer.
The first idea that comes to mind is simply get permission to use a book, grab all the questions and answers using a DB and display the right answer. But how would I display the answer or the show me how the answer was derived.
My confusion is; how does this work?:
Do I have to write all the formulas and answer myself?
Are there programs for this?
I do not even know where to start.
What I would like to do is have the user select an answer, if the answer is wrong, they can click the show me button.
I am looking to either write this in C#, Visual Basic using JQuery on the front end.
Just need some direction.
Thanks my friends.
When I was in college I had to do something very similar.
What I did is stored expressions 4 + 5; 1 * 6 in database and then pushed those expressions to evaluate on run-time because it is pretty easy in C#.
It takes expression from database 2 + 2
It evaluates the expression on run-time producing result 4
You get your result and show it to user or do whatever with it
More info on how exactly to do that: http://www.c-sharpcorner.com/UploadFile/mgold/CodeDomCalculator08082005003253AM/CodeDomCalculator.aspx
I don't think you need to evaluate a stored expression. Since you just want the user to enter multiple choice or the answer itself, just set up your database as follows:
QuestionAnswers:
ID (uniqueidentifier) (primary)
QuestionText (varchar)
QuestionAnswer (varchar)
ShowMeHowEquation (varchar)
Then, display the ShowMeHowEquation via jQuery like so:
Show Me How
<div class="showMeHowEquation">Database driven contents here...</div>
<script>
$(document).ready(function() {
$('.showMeHow')click(function() {
$(this).next('.showMeHowEquation').slideDown();
});
});
</script>

Categories