4,439 Posted Topics
Hi all, I can easily add this using clause with no errors to my program. [B]Using System.Numeric;[/B] I have VS 2008 C#. But I'm not seem to be able to use it. The Object Browser gives no clue either. Any suggestion is very welcome. | |
Re: @Serkan : I'm not an expert in English nor in C#. IMHO Scott will deserve that epitheton for C#. But I see it this way : [B]My car doesn't start.[/B] Means: I tried to start my car [B]now[/B], but without effect. [B]My car won't start.[/B] Means: I already started my … | |
Re: Glad you're happy Serkan:) If you want your dictionary always sorted you could use SortedDictionary like this: [CODE=c#]class Program { static void Main(string[] args) { // Make a new dictionary of strings, with int keys. Dictionary<int, string> MyCoctails = new Dictionary<int, string>(); // Get the keys with the Keys property. … | |
Re: Just to be sure : is your file named Example.[B]I[/B]nk or Example.[B]l[/B]nk ? | |
Re: Do an elevator simulation with at least 3 elevators and 7 floors. And learn to write some decent English. ![]() | |
Re: See you are making use of the snippet: [url]http://www.daniweb.com/code/snippet1022.html[/url] Nothing wrong with that it is there to get used. But in the explanation of that snippet I explain I call this code from the Paint event, not from the Load event of the form. | |
Re: If you search for [B]print datagrid [/B]on this site you will find lots of threads on the subject. Example : [url]http://www.daniweb.com/forums/thread202609.html[/url] | |
Re: Are you looking for an AI (Articial Intelligence) approach? | |
Re: Is this a console application or a forms application? | |
Re: IMHO characters in a bitmap or jpeg or whatever consist of colored pixels, just like the rest of the image. In a text there is a relation of the characters with some kind of code like ASCII, you don't have that in an image. | |
Re: [QUOTE] i tried putting the count into an arraylist and sort it from there but it does not work[/QUOTE] Could you show us the code that did not work? | |
Re: Operator overloads sure have their use. I don't see why you want to overload the C# ++ operator! It is there for your use! So use it as such, don't get fancy because you like to do it. An index can easely be incremented with ++. Einstein once said: keep … | |
Re: Salem, don't bother... Whenever sivak has forgotten to take his pills he starts to spam this site with trivial questions. Harmless maybe, I consider this person nowhere to be found in a giant void. | |
Re: As you know C++ already, learning C# will not be so difficult. Although both languages have much in common there are differences. I suppose you want to work in a .NET environment. Now THAT will be the hardest part to learn I guess. .NET is HUGE! About 12 months ago … | |
Re: There is a file copy method in the File class : File.Copy( OriginalPath, CopyPath ); | |
Re: I think you have to look in the Controls collection of panel1, now you are looking in the Controls collection of the form. So instead of [B]Controls.Find [/B]use [B]panel1.Controls.Find[/B] | |
Re: lnewvalue is an integer. You must use a char or a string here. Remark: I would not use [B]Array [/B]as a variable name, because it is also a type in .NET. Choose a more appropriate name instead. | |
Re: Use something like this: [CODE=c#]using (StreamReader sr = new StreamReader(path)) { while (sr.Peek() >= 0) { Console.WriteLine(sr.ReadLine()); } }[/CODE] | |
Re: A Form has a Controls collection. To Add a control at runtime you say :[B] Myform.Controls.Add(MyTextbox);[/B] To remove it you use[B] Myform.Controls.Remove(MyTextbox);[/B] | |
Re: To make it not so messy you could define a string like this : [B]string selection = comboBox19.Items[comboBox19.SelectedIndex].ToString() ;[/B] and change your if-statement in : [CODE=c#]if (selection == "Clear Float") glassType10 = 200; else if ( selection == "Low E") glassType10 = 250; //......[/CODE] Yes, you may omit the curly … | |
Re: Here is a comparision between the syntax of the two languages: [url]http://www.harding.edu/fmccown/java_csharp_comparison.html[/url] A language as such, does not do that much. It is the framework or the libraries that come with it, that make it powerfull. You choose the language you feel most confortable with. This decision is all up … | |
Re: I found this Tamil unicode chart which may help a little : [url]http://www.unicode.org/charts/PDF/U0B80.pdf[/url] | |
Re: I should say: overide the Show method of the MessageBox class. In the overide play the sound(async), then Show the messagebox. | |
Re: The outcome of [B]if ((max_value - min_value) < 0.01)[/B] depends on the values in your table. If this never becomes true, you iterate forever and will get a stackoverflow. | |
Re: Paul is a very nice guy. The more people like him the better! | |
Re: CalculateTotal should only do what it says : Calculate a total. Your method writes the result of a power calculation to the console. In a small program like this it seems not to matter too much, but if you are working on a large project with many programmers, such things … | |
Re: The String class has a [B]Remove [/B]method. It can remove chars from a certain position and of a certain length. | |
Re: [QUOTE]I got the code for the exit button which is: this.button2.Click += new System.EventHandler(this.button2_Click); this.Close();[/QUOTE] The code will compile, but it seems to me like you are blinded and then try to break an egg with a stick. Are you using VS 2008 C# or a C# command line compiler? … | |
Re: You may also lokk at this snippet : [url]http://www.daniweb.com/code/snippet1094.html[/url] | |
Re: Have a look at this: [url]http://www.xmlfox.com/print_datagridview.htm[/url] BTW: [COLOR="Red"]I need it urgent.[/COLOR] does not give me the impression you are a friendly person. What about [COLOR="Green"]Could someone out there offer any help?[/COLOR] Besides, the link I gave you took me 5 secs to google... | |
Re: You already posted the same thread on wich we gave replies : [url]http://www.daniweb.com/forums/thread202311.html[/url] | |
Hi all, I have made (just to learn C#) a calculator program, which is working OK. I made a Round button class for it, but the edges of the buttons still look "crispy". I set [B]SmoothingMode [/B]and [B]PixelOffsetMode[/B] to [B]HighQuality[/B] but it seems to have no effect. Is this once … | |
Re: An apple an a pear are both fruits. You can even say that they belong to the same plant family [url]http://en.wikipedia.org/wiki/Rosaceae[/url] You can never say an apple IS a pear. | |
Re: This works with me: decimal dec = 123.4567M; string str = dec.ToString("0.##"); MessageBox.Show(str); MessageBox.Show(String.Format("{0:0.##}", dec)); dec = 123.0M; str = dec.ToString("0.##"); MessageBox.Show(str); MessageBox.Show(String.Format("{0:0.##}", dec)); | |
Re: As Ramy says, you can IMHO only do this programatically. | |
Re: Just so happens I was doing some "animation" testing with matrix transforms. Put it in a snippet: [url]http://www.daniweb.com/code/showsnippet.php?codeid=1250[/url] | |
Re: Is it so hard to post your code in this format? Using code tags I believe this is your MergeSort function : [CODE=c#]public void MergeSort(int l, int h) { if (l >= h) { return; } int mid = (l + h) / 2; MergeSort(l, h); MergeSort(mid + 1, h); … | |
Re: Reading this might help : [url=http://www.codeproject.com/KB/cs/datetimelib.aspx?fid=188986&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=26&select=1153099]info[/url] | |
Re: Perhaps something like this: string str = string.Empty; DateTime T = DateTime.Now; str = T.ToString("hh:MM:ss"); MessageBox.Show(str); | |
Re: NumericUpDown does not work with [B]integer [/B]but with the data type [B]decimal[/B] It ranges from +-1.0 X 10e-28 to +-7.9 X 10e28. | |
Re: I think I know what you mean, but give yourself some simple goals, like: print out the numbers 1 to 10 and their squares. Or: draw a blue rectangle on a yellow background. You can only train yourself in programming, by programming for yourself, no matter what the exercise is. | |
Re: Your code seems pretty OK. In the example you give [B]ammar hassan[/B], could it be that there is a space char instead of a tab char between ammar and hassan? | |
Re: I downloaded it about a year ago, still learning:cool: but I believe I can help. Your code : [B]if (ok.player > 51% ok.maxhp)[/B] The % is not what you think a percentage, it is the modulo operator! So you are comparing something against 51 modulo ok.maxhp, which is not what … | |
Re: You have several options here : If eno is an int then: eno = Convert.ToInt32(Console.ReadLine()); or eno = int.Parse(Console.ReadLine()); or bool succes = int.TryParse(Console.ReadLine(), out eno); | |
Re: Lines 16 and 17 of your code never get executed, because the function on line 22 always returns false. Play computer like I did! It's fun! You will see why your int array fills up with all nines! | |
Re: I fully agree Ramy! Does a [B][COLOR="Red"]}[/COLOR][/B] counts as a line of code? Hard work indeed! | |
Re: MessageBox is very versatile, but you cannot use a radiobutton in it. For that you have to design your own dialog, which is something not so difficult to do. | |
Re: When I experience a NullReference exception(using VS 2008) The line that it occured in is pointed out to me, together with some tips. Could you please give us the line where the NullRef occured? Also the use of [COLOR="Red"]code tags [/COLOR]is strongly reccomended. |
The End.