4,439 Posted Topics
Re: Hi, OsheRono! Welcome at Daniweb. Another way to do this (if I understand your post well) is to use a set of radiobuttons in a GroupBox control. | |
Re: If you are in your final year and you still have not picked up a part of your studies which interests you (and hence would give you a clue for a subject for a project), you should better quit studying. | |
Re: [url=http://mathbits.com/MathBits/CompSci/Introduction/frombase10.htm]This site[/url] should give you a very good idea how to do it. Hint: Try to remember the outcome of your divisions and then print them out. | |
Re: You could use the shift left operator << here! Math.Power is a very "expensive" function to call. Convert.ToInt32((Math.Pow(2, i) should give the same as 1<< i [CODE=c#] a = Convert.ToInt32((Math.Pow(2, i); b = 1 << i; //multyply by 2 by shifting 1 bit to the left // a and b … | |
Re: 3D is a world of it's own. I suggest first reading "3D programming for windows" from Charles Petzold. Learn about the math needed(quaternions ! fun!) Learn about projections, light, shade, viewports, rotation etc. Mostly with XAML code but also C# code. Very good book. | |
Re: @apegram : In case you did not know(which I doubt) you just set out all the combinations of 5 elements in groups of 1 to 5 without repetition! [url=http://en.wikipedia.org/wiki/Combinations]Look here.[/url] Was working on this same problem using the combinatorial approach(trying to write a combination method:-/ ) and with your list … | |
Re: Hi forhacksf, welcome at daniweb! Have a look at this thread: [url]http://www.daniweb.com/forums/thread201807.html[/url]. It is not about your problem but it contains a zip file somewhere of a calculator in C# that might give you some ideas. It is a "clone" of a little pocket calculator I have at home not … | |
Re: Hi thuyson, welcome at daniweb! Do you mean you want to show the contents of a textbox in a different place on the same form, by clicking a button? | |
Re: Hi ernst1234, welcome at daniweb! Please use code tags when you post code. Use the Location property of the Label to move it. You have to use the Refresh() method of the form to make that happen. | |
Re: [B]1.[/B] You could see them as "placeholders" [CODE=c#] int a = 23; int b = 34; Console.WriteLine("Result is {0}, second result is {1}.", a ,b );[/CODE]will produce: [B]Result is 23, second result is 34.[/B] 2. ToString is a basic method all objects have. Because everything is C# is an object … | |
Re: Your Paint event handler does just what you told it to do: Draw a green line with a width of ten, from the point you did a mousedown until the point you released the mouse. Reread the advise Ryshad gave you in your previous thread about this subject: [url]http://www.daniweb.com/forums/thread261808.html[/url] | |
There seems to be a lot of shuffling going around here lately. So I looked [url=http://en.wikipedia.org/wiki/Shuffling]here[/url] to learn about the Fisher-Yates shuffle etc. But unless my English is not good enough I did not find anything about the way we shuffle a card deck here. Take a deck in your … | |
Re: Hi andrew2325, welcome here at daniweb! I should try to use a list of struct instead of string, like this: [CODE=c#] struct GradeStruct { string name; int one; int two; int three; } List<GradeStruct> MyGrades = new List<GradeStruct>();[/CODE] Read a line of your file and split it into 4 strings … | |
Re: @ejazmusavi In case you do not know, live itself is not easy! Try to learn as much as you can, maybe from something you don't understand completely at first. If you have a question: ask! | |
Re: Off course you can always save you the trouble of doing it yourself and use format specifiers like this: int value = 32767; Console.WriteLine("{0,10:G}: {0,10 : X}", value); Which will output: 32767: 7FFF | |
Re: For a starter, leave out the for loop on line 14. Change the i in lines 16 and 17 into AantalRijen. This should perhaps already help you out a bit. Keep you informed but have not much time right now. Succes gewenst! | |
| |
Re: Make a windows form application, drop a button on it from the toolbox and see what code is generated in the XXX.designer.cs file. Should give you a start. This is the way I did it to find out some things. Succes! | |
Re: Hi Dragonator, welcome here at daniweb! It just so happens I'm working on a matrix calculator project. Well not all the time of course;) And it is far from finished! I use a class derived from DataGridView to show or edit a matrix. I may have my the code here … | |
Re: I believe .NET can do most of what you want to do. Look at this little snippet for an example: [url]http://www.daniweb.com/code/snippet217413.html[/url] If this is not what you really want --> Google For example: [url]http://www.downloadjunction.com/product/software/28425/index.html[/url] Succes! | |
Re: Seems you are putting your own code in your XXX.designer.cs file. You should do that in the XXX.cs file. The XXX.designer.cs file is maintained by Visual Studio, it may overwrite anything you put in there. | |
Re: [QUOTE=Narue]Your first example is a syntax error because it's neither a method nor a property[/QUOTE] Although the rest of your explanation is quite good, I was asking myself, why must a method have parameters? IMO it can be parameterless, or did you mean something totally different? | |
Re: Coud you be more specific? You also seem to have posted double code. | |
Re: Perhaps you can get some ideas looking at [url=http://www.daniweb.com/code/snippet217413.html]this snippet[/url]? | |
Re: Check out this snippet [url]http://www.daniweb.com/code/snippet217084.html[/url] it is about numerics, but perhaps it helps. | |
Re: If you have more LINQ snippets, please don't hesitate to post them! | |
Re: Perhaps this would be a good time to learn some more C# and get to know something more about properties e.g.: [url]http://www.csharp-station.com/Tutorials/Lesson10.aspx[/url] | |
Re: Put your code in the Form1_Paint method. Leave out the CreateGraphics, the EventArgs argument is kind enough to provide you one : e.Graphics The OnPaint method calls the Paint event of the form so I would leave that for now. You should have a KeyDown event handler where you could … | |
Re: Hi bmasta12 welcome. Could you to help us, use code tags to show us your code? Leave the upper case coding style. Tell me what is more readable: ACADEMIC_PROFILE ACADEMIC_PROFILE_SCREEN = new ACADEMIC_PROFILE(); AcademicProfile AcademicProfileScreen = new AcademicProfile(); and if I use that between code tags I get: [CODE=c#]AcademicProfile AcademicProfileScreen … | |
Re: This is a great article about color : [url]http://www.codeproject.com/KB/recipes/colorspace1.aspx#hsb[/url] | |
Re: Every textbox has a MaxLength property you could test for . Default it is set to 32767 chars. | |
Re: Why can't you put all your textboxes in a list? Like this: [CODE=c#]List<TextBox> MyTBList = new List<TextBox>();[/CODE]Look up what you can do with a List, you will be suprised! | |
Re: First you have to extract a word from your text file. Second compare it with the word you want to search. true?-->found! false?-->extract the next word from the file and compare again etc. until the end of file is reached. | |
Re: If you know all your strings start with "x", you could use: [CODE=c#]string test = "x11"; test = test.Remove(0, 1);//remove 1 char at position 0 int i = int.Parse(test);[/CODE] | |
Re: Do you mean a Form class? Here is some info about its members: [url]http://msdn.microsoft.com/en-us/library/system.windows.forms.form_members.aspx[/url] | |
Re: Comment on the side: never use [B]o[/B] as an index variable! Can be confused with 0 (tell me: is this the letter o or the digit o?) I used to program in FORTRAN IV. If you used a letter like I, J, K... it was an integer. I think these … | |
Re: I think you cannot define a class in Main, so define it outside of it. EDIT: apegram just passed 2 secs before me, but I can live with that... | |
Re: What have you tried for yourself already, or are you completely lost about this? | |
Re: Depends on what you want. You could build it from scratch, so you have all the control. You could also try to use a TableLayout or even a DataGridView control. | |
Re: Do you mean a GridView or DataGridView? What have you already tried for yourself? I did the effort of googling for [I]DataGridView[/I] and came up with: [url]http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.aspx[/url] | |
Re: If I understand you well, I should have a Horse class, and put it in a List of Horses. Every Horse should have(among others) an int property Track(or something) giving you the track number. | |
Re: Check out the code snippet section. Among others: [url]http://www.daniweb.com/code/snippet217084.html[/url] | |
Re: Perhaps java substring works a little different, this is a translation to C#: [CODE=c#]using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MonthStrings { class Program { static void Main(string[] args) { string monthString = "JanFebMarAprMayJunJulAugSepOctNovDec"; Console.WriteLine("Enter a month: "); string answer = Console.ReadLine(); int mon; bool succes = int.TryParse(answer, … | |
Re: Maybe [url=http://blog.figmentengine.com/2008/09/finding-duplictes-in-array.html]this article[/url] will help also. | |
Re: koekoeksklok, (translation: cuckoo clock :?: ) I live near Antwerp, have many friends there. If you want to become my friend, don't do this again and read the forum policies as Ryshad already pointed out. | |
Re: The problem is with your string array declaration. string[] fNamearray = null; According to this definition [B]DataType[] VariableName = new DataType[Number];[/B]this should be something like: string[] fNamearray = new string[10]; See also : [url]http://www.functionx.com/csharp/Lesson21.htm[/url] | |
Re: Do not see directly what you have trouble with : The example you give just constructs a string with Rowindex and ColumnIndex data which it gets from the [B]e [/B]parameter which is of type DataGridViewCellEventArgs . Then this string is displayed in the MessageBox. | |
Re: Maybe [url=http://msdn.microsoft.com/en-us/library/aa289152(VS.71).aspx]this article[/url] can help? | |
Re: PrintArray is declared once on line 36. It is called twice on lines 17 and 19. Once to print out the unsorted array. Once to print out the sorted array. | |
Re: Rounding is in fact a rather complicated matter. [url=http://en.wikipedia.org/wiki/Rounding]Look here.[/url] |
The End.