4,439 Posted Topics
Re: Have a look at these snippets: [url]http://www.daniweb.com/software-development/csharp/code/351309[/url] | |
Re: You will find all the info you need here: [url]http://msdn.microsoft.com/en-us/library/system.io.streamreader(v=VS.100).aspx[/url] | |
Re: You could start having a look at this: [url]http://www.daniweb.com/software-development/csharp/threads/352156[/url] | |
Re: [QUOTE=Xcelled194]But this isn't the place for a debate over NET vs Regex.[/QUOTE] So why did you start one? You cannot compare .NET with regex. Also have a look at sed, awk and grep. Also have a look at the regex variants for Perl, Ruby, PHP, Python, C, Java. | |
Re: Only have an answer for your second question. Use the newer ToolStripMenuItem instead of MenuItem. ToolStripMenuItem allows you to set the Font property at runtime. | |
Re: If the type of [B]answere [/B]is string then you must compare against a string. 'j' and 'J' are of type char. To make them string, use "j" and "J". | |
Re: Yes! Only a [B]void [/B]method does not need a return statement. | |
Re: Another "bad" thing is to use short variable names like a or b. Call them TitleStr or AuthorStr or something more meaningfull. Short variable names may seem harmless here, they will kill you in code of a 1000 and more lines! On line 52 change a + "\n" + b … | |
Re: The open file dialog returns a file name. Directory.GetFiles expects a path to a directory, not a file. Use the folderBrowserDialog instead, something like this: [CODE=C#] private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK) { string folderName = folderBrowserDialog1.SelectedPath; string[] names = Directory.GetFiles(folderName); //more code... }[/CODE] | |
Re: Smells like . . . you asked this before [url]http://www.daniweb.com/software-development/csharp/threads/352641[/url] | |
Re: I used [url=http://www.codeproject.com/KB/printing/datagridviewprinter.aspx]this code[/url] once in a small project and it worked perfectly. Done a little modification, but that had to do with what I wanted to do, not because the code was bad. | |
Re: [QUOTE=NOVICE3]if (responsibleDialogResult != DialogResult.Cancel)[/QUOTE] Is it so hard to say [B]if (responsibleDialogResult == DialogResult.OK)[/B] ? What is [B]tempArray [/B]? | |
Re: With the help of LINQ this is easy: [CODE=C#]static void Main(string[] args) { string[] first = { "John", "Dave", "Mary" }; string[] second = { "Danny", "Nicole", "Mary" , "James"}; IEnumerable<string> intersect = first.Intersect(second); Console.WriteLine("*** First array:"); foreach (string name in first) Console.WriteLine(name); Console.WriteLine("*** Second array:"); foreach (string name in … | |
Re: chessPics is a 2D array that can hold 81 PictureBox elements. You still have to allocate these elements. Example [B]chessPics[0, 0] = new PictureBox();[/B] will do that for the first element in your array. | |
Re: I had a similar problem, have a look [url=http://www.daniweb.com/software-development/csharp/threads/224213]at this thread[/url] You just have to put your DataGridViewData in a DataSet. Maybe it helps. | |
Re: WHAT error? WHERE did it occur? How do you expect us to give you an answer? If you post something that is vague, hazy and not even a question but a sentence formulated as a statement? | |
Re: [url]http://www.codeproject.com/KB/printing/multipadprintdocument.aspx[/url] | |
Re: Perhaps by using some boolean and logic operators in C#, you could write a logical gate simulator in C#! | |
Re: You created two different 2D arrays named [B]temp [/B]and [B]pieces [/B]each consisting of 81 objects of type [B]Pieces[/B]. | |
Re: You have to insert the newline charater, or instead of using Write, use WriteLine. | |
![]() | Re: Hello Falcon25, welcome. What do you think should be the type of your elements array in your posted code? You will also need some kind of looping, here is a start: [url]http://msdn.microsoft.com/en-us/library/ch45axte.aspx[/url] |
Re: What do you mean by tough? I once found for example properties in C#, a bit hard to grasp. Now I wonder why I could ever have done without them. | |
Re: Hello iThink, welcome! You could set the cursorposition. have a look here: [url]http://msdn.microsoft.com/en-us/library/system.console.setcursorposition(v=VS.85).aspx[/url] | |
Re: It boils down to this: [url]http://msdn.microsoft.com/en-us/library/system.string.indexof(v=VS.90).aspx[/url] If I where you I should print a list of the string members class, enlarge and print it out. Hang it in your room. This will help you out alot of times believe me. | |
Re: Perhaps a peek at [url=http://www.daniweb.com/software-development/csharp/code/238279]this snippet[/url] may set you on the way. | |
The DataGridView class is huge and complex. It is a beast I'm still struggling with, but once you learn to comprehend it, I find it most rewarding! Some try to circumvent it by using listboxes and the lot. Why don't get your feet wet with this as basic as it … | |
Re: You got to set the format of the excell cell to TEXT | |
The next code from the book "Pro-linq language itegrated query in C# 2008" gives a casting exception error on line 29. I know ToArray returns an array of objects, which are in fact of type Employee so why it generates an error? [CODE=C#]public class Employee { public int id; public … | |
Re: The first computer I worked with at home was [url=http://en.wikipedia.org/wiki/Texas_Instruments_TI-99/4A]this one[/url] It runned at a clockspeed of 3 MHz. And 3 MHz was fast in these days! The computer I'm typing this on runs at 2.2 GHz. So the overhead of calling a method really does not matter that much. … | |
Re: I worked out this, but this is perhaps not what you want. [CODE=c#]using System; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { XElement Refs = XElement.Parse( @"<References> <sport> <type>football</type> <Info>11 man team</Info> </sport> <sport> <type>tennis</type> <Info>40 love</Info> </sport> <sport> … | |
Re: It works if you add a space to your char array [CODE=c#]char[] cInvalid = { '\', '-', '/', '*', '?', '<', '>', '|', ' '}; [/CODE] I guess Trim defaults to whitespace trimming if it can't find a char to trim in the cIvalid array. | |
Re: Just to add: In the Build menu you will find the Publish item, that starts a wizard. | |
Re: I would create a Customer, Account and a Transaction class. A Customer class would have a List<Account> and an Account class would have a List<Transaction> | |
Re: Use an OpenFileDialog control in your form. | |
| |
Re: I guess when you say "the conditions stops" mean you are not entering the if statement. This can only mean one thing: [B]specifypurposetb.Text.Length [/B]is not equal to zero. | |
Re: In the Build menu you will find a Publish item. Click on it and a wizard will start that will guide you through the process. If it is a simple application you could look in the bin folder of your project. If you compiled your app in release mode, you … | |
Re: Call the forms Close() methods of both forms. If you no longer need the forms you cold call the Dispose() methods. | |
Re: Have a look at this: [url]http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx[/url] | |
Re: pArray is short for personArray I guess. pArray stands indeed for an array of Person. You can pass an array of Person to the constructor of the People class. Because the People class inherits from the IEnumerable interface it has to implement its methods. | |
Re: A ContextMenuStrip with shortcut keys!?! You come from outer space and have three hands,right? One hand to hold the right mouse button, the two others for typing the shortcut key combination? Or do I see this all wrong and am I just being dumb? | |
Re: Alternatively you could use a Random constructor with a different integer seed value. public Random randomizer = new Random(seedGrey1); | |
Re: The rejection of the geocentric over the heliocentric model by [url=http://en.wikipedia.org/wiki/Galileo_galilei] this man[/url] merely doing some scientific observations with a telescope was a start. | |
Re: Reminds me that somewhere in the seventies of the previous century, I saw [url=http://en.wikipedia.org/wiki/Soylent_Green]this movie.[/url] Still 11 years to go... [COLOR="Green"]"Soylent Green is PEOPLE!! We've got to stop them—SOMEHOW!!!"[/COLOR] Edit: I still know how to kill and prepare a living chicken. It should be teached at school! | |
Re: Have a look here: [url]http://www.daniweb.com/software-development/csharp/code/217265[/url] | |
Re: Or you could try [CODE=c#]DateTime dt = DateTime.Parse((reader["dtFrom"]).ToString()); [/CODE] | |
Re: Your question is somewhat unclear. Could you explain a bit more? | |
Re: Ever heard of the word google? Example: [url]http://msdn.microsoft.com/en-us/library/system.windows.forms.progressbar.aspx[/url] |
The End.