2,157 Posted Topics
Re: Use the location method of the label to get the, well, location. Then use the standard distance formula to calculate the distance (Square root of ((x1-x2)^2 + (y1-y2)^2)). | |
Re: C# doesn't have header files. The [icode]using[/icode] just allows you to reference objects in a namespace without having to fully specify the namespace (as long as there are no conflicts). For example: [code]using System.Transactions public void MyMethod() { Transaction t1 = new Transaction(); System.Transactions.Transaction t2 = new System.Transactions.Transaction(); }[/code] The … | |
Re: Did you want it like a clock, where you count down the right side and when it reaches zero the left side decreases by one then the right side starts counting down from 20 again, etc.? | |
Re: If you are sure it's in the ValidateMail assembly, is it declared public? | |
Re: Then you will have to customize the code to support databinding. You'll have to figure out how to tell it what is a root node and what are child nodes. | |
Re: You are trying to do math with a string [icode]saldo = saldo - '" + cantidad.ToString() + "'[/icode]. If cantidad is a number, then you want [icode]saldo = saldo - " + cantidad ...[/icode]. Leave out the single quotes (') around cantidad. | |
Re: [code]string filePath = @"c:\Users\Fish\Desktop\fyp-coding\Data.txt"; String[] myLines = File.ReadAllLines(filePath); textBox7.Text = myLines[myLines.Length - 2];[/code] | |
Re: You try this:[code] if (BEngCheckBox.Checked == true) { BEngBasicBonus = basicPay * 1.1F; BEngOvertimeBonus = overtimePay * 1.1F; BEngBonus = (BEngBasicBonus + BEngOvertimeBonus) - (basicPay + overtimePay); BEngLab.Text = "BEng. Bonus = " + BEngBonus.ToString("c");//show if check box checked } else { BEngLab.Text = String.Empty; }[/code] | |
Re: [icode]onClick='sendDataST(document.getElementById('begP').value[/icode] The statement ends on the second ' mark. Use " to enclose values: [code]<input class = "btn" name = "calculate" type = "button" VALUE="Shortest Path" onClick="sendDataST(document.getElementById('begP').value + '\n' + document.getElementById('endP').value + '\n')">[/code] | |
Re: Instead of creating a new class and methods to fill the class we can use LINQ to do that for us: [code]var allItems = item.Zip(location, (i, l) => new {Item = i, Location = l});[/code] | |
Re: Looks like you are running into the problem with capture variables. Try assigning the enumerated value to a temp variable before you use it, i.e.[code]foreach (string s in fileEntries) { string temp = s; t = new Thread(() => Shrink(temp)); t.Start(); }[/code] | |
Re: I've not run your code, but I suspect your problem is in lines 42-49. [code] for (int i = 0; i < 8; i++) { if (tour.move((curr_row + x_inc[i]), (curr_col + y_inc[i]))) { tour.insert((curr_row + x_inc[i]), (curr_col + y_inc[i])); } tour.solve_from(tour); }[/code] You call tour.solve_from() even if you didn't add … | |
Re: [url]http://www.onecomputerguy.com/ie_tips.htm#restrictions[/url] | |
Re: Create a new constructor for Form2 that takes a string parameter and store the value in Form2: [code]String whatTable; public Form2(String table) { whatTable = table; InitializeComponent(); }[/code] Now in your button click event you create the form and tell it which table: [code]Form2 myForm2 = new Form2("GameTable");[/code] | |
Re: [code]Get your list of image values. Sort these values. Set minimum group threshold size (minG) Set maximum difference (minD) Set i = 0 While (i < number of images - minG) { Set j = i - 1 While (j >= 0) { Calculate difference between image i and image … | |
Re: Easy way to do what you want is to declare the methods, attributes and class as static (The Account class). Then you can access them without having to create an instance variable (the new Account() stuff). So your code becomes [icode]Account.setName("Phillip");[/icode] and [icode]Account.getName();[/icode]. This technique is best when there will … | |
Re: Easy way to do this is create a new class: [code]static public class MyConnection { static public String ConnectionString { get; set; } }[/code] Then at the beginning of your code, put [code]MyConnection.ConnectionString = "whatever your connection string is";[/code] Then anywhere you need the connection string you'd use [code]OleDbConnection connection … | |
Re: Do you mean a [URL="http://www.livescribe.com/en-us/smartpen/"]Smartpen[/URL]? If so, you don't. The .NET libraries don't lend themselves to embeded software. | |
Re: You are setting the SeatArray [B]name[/B] equal to pointer [B]name[/B], not copying the name. Use [URL="http://www.cplusplus.com/reference/clibrary/cstring/strcpy/"]strcpy[/URL]. | |
Re: [URL="http://www.codeproject.com/KB/cs/HowToRunPowerShell.aspx"]This[/URL] project shows how to run powershell scripts in C#, might help you. | |
Re: Assuming your TextBox is named textBox1, you do this: [code]char[] myCharArray = textBox1.Text.ToCharArray();[/code] You can also treat a string as a character array without converting: [code]foreach (char c in myString) { ... etc ... } // or for (int i = 0; i < myString.Length; i++) { char c = … | |
Re: [URL="http://en.wikipedia.org/wiki/Quicksort"]Quicksort[/URL] - read the section on choice of pivot. | |
Re: This what you are looking for [URL="http://msdn.microsoft.com/en-us/library/bb324225%28v=vs.85%29.aspx"]Audio.Balance[/URL] | |
Re: [code]public String Name {get; set;}[/code] This defines a public property called Name. The compiler will generate the backing field and all the code needed for you. You can also include access modifiers: [code]public String Name {get; private set;}[/code] In this case the set is private, so can only be called … | |
Re: [code]if (Regex.IsMatch(allRead, regMatch)) { MatchCollection matches = Regex.Matches(allRead, regMatch); foreach (Match m in matches) { Console.WriteLine(m.Value); } }[/code] | |
Re: Since you changed the error, I'm changing my post. Hold on :) | |
Re: [QUOTE=ddanbe;1478888]Do you think it helps by posting this question in the C# forum?[/QUOTE] I do, since java is a poor man's C# | |
Re: In general header files are where you describe the class/methods, the class file is where you actually implement the class/methods. | |
Re: Temperature is the probability that a move that doesn't improve the situation is taken anyway. This value starts high at the beginning, but lowers as time (or iterations) go on. Schedule is the method that returns the current temperature. | |
Re: [URL="http://en.wikipedia.org/wiki/ANSI_escape_code"]ANSI escape codes[/URL]. Not for the faint of heart. | |
Re: Do you remove the labels from the control collection before you dispose of them? The behavior you are experiencing leads me to believe that the controls are still referenced somewhere. | |
Re: Add this:[code]public static class TextBoxWatermarkExtensionMethod { private const uint ECM_FIRST = 0x1500; private const uint EM_SETCUEBANNER = ECM_FIRST + 1; [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam); public static void SetWatermark(this TextBox textBox, string watermarkText) { SendMessage(textBox.Handle, … | |
Re: You have to declare them outside the loop. Read this about [URL="http://www.techrepublic.com/article/intro-to-oop-java-scope-rules/5035301"]scope[/URL]. | |
Re: The height of a textbox is based on the font size. Other than making it multiline you don't get to adjust it. You might be able to do it at runtime but the designer won't let you. | |
Re: Line 10 you increment j instead of k. You'll also probably have an issue with line 7 since you allow j to go to n, which is outside the array bounds. | |
Re: More information please :) What properties do you need? What are you trying to do? What code do you have now? | |
Re: It appears your are used to procedural programming (where each line is executed one after another, input stops the system, etc.) What you need to learn is event driven programming (which is what all GUI based systems are doing). You don't 'stop' the execution. You set up the GUI and … | |
Re: [code] DialogResult result = MessageBox.Show("Please select yes or no", "Yes, no?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { // they pressed yes } else { // they pressed no } [/code] There are a lot of other options for [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox.aspx"]MessageBox[/URL], you should read up about them :) | |
Re: if you put it in the same directory as the executable then you don't need the path. | |
Re: [code]String url = "http://www.youtube.com/results?search_query=" + textbox1.Text.Trim().Replace(" ", "+") + "+" + textbox2.Text.Trim().Replace(" ", "+") + "&aq=f";[/code] | |
Re: If your insert is working correctly they should be in sorted order. | |
Re: [URL="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx"]SqlBulkCopy[/URL] is probably the fastest (and fairly easy) method to use. | |
Re: Each connection type has a class for building connection strings, such as the [URL="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.aspx"]SqlConnectionStringBuilder[/URL]. You can put all the parts you need into your app.config like you have now and then build your string. If the user needs to change part of it, you just change that part. | |
Re: It's not clear what you want to accomplish. Do you want to have both buttons link to the same event, then have the code determine which form should be generated and shown? | |
Re: Depending on your experience, it shouldn't take more than a week for a beginning program (based on the little that you have given). | |
Re: So you have three parts: Some date Some text (which according to you could be anything) Some other text (which accroding to you could be anything) You can split the date from the rest, that's not hard to do. But unless there is some format to the other two (something … |
The End.