2,157 Posted Topics

Member Avatar for odiejodie

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)).

Member Avatar for JamesCherrill
0
155
Member Avatar for sneha mehta

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 …

Member Avatar for Momerath
0
94
Member Avatar for Jessurider

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.?

Member Avatar for prvnkmr194
0
99
Member Avatar for sneha mehta

If you are sure it's in the ValidateMail assembly, is it declared public?

Member Avatar for Momerath
0
64
Member Avatar for lianpiau

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.

Member Avatar for lianpiau
0
1K
Member Avatar for jotae

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.

Member Avatar for kvprajapati
0
108
Member Avatar for Kath_Fish

[code]string filePath = @"c:\Users\Fish\Desktop\fyp-coding\Data.txt"; String[] myLines = File.ReadAllLines(filePath); textBox7.Text = myLines[myLines.Length - 2];[/code]

Member Avatar for Momerath
0
83
Member Avatar for JudeV
Member Avatar for johnt68

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]

Member Avatar for johnt68
0
116
Member Avatar for sdr001

[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]

Member Avatar for Fbody
0
169
Member Avatar for revjim44

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]

Member Avatar for Momerath
0
131
Member Avatar for chintan_1671

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]

Member Avatar for chintan_1671
0
205
Member Avatar for Kontained

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 …

Member Avatar for Kontained
0
634
Member Avatar for akshayinbox
Member Avatar for akshayinbox
0
100
Member Avatar for ajinkya112

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]

Member Avatar for Momerath
0
187
Member Avatar for valter

[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 …

Member Avatar for Momerath
0
109
Member Avatar for Phil++

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 …

Member Avatar for abelLazm
0
166
Member Avatar for lianpiau

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 …

Member Avatar for lianpiau
0
478
Member Avatar for dilake

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.

Member Avatar for Momerath
0
77
Member Avatar for Firedown

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].

Member Avatar for WaltP
0
119
Member Avatar for adelsin

[URL="http://www.codeproject.com/KB/cs/HowToRunPowerShell.aspx"]This[/URL] project shows how to run powershell scripts in C#, might help you.

Member Avatar for Momerath
0
65
Member Avatar for kul1508

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 = …

Member Avatar for Momerath
0
78
Member Avatar for Lelly

[URL="http://en.wikipedia.org/wiki/Quicksort"]Quicksort[/URL] - read the section on choice of pivot.

Member Avatar for mrnutty
0
532
Member Avatar for Xcelled194

This what you are looking for [URL="http://msdn.microsoft.com/en-us/library/bb324225%28v=vs.85%29.aspx"]Audio.Balance[/URL]

Member Avatar for Xcelled194
0
147
Member Avatar for pseudorandom21

[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 …

Member Avatar for Momerath
0
99
Member Avatar for benjie987

[code]if (Regex.IsMatch(allRead, regMatch)) { MatchCollection matches = Regex.Matches(allRead, regMatch); foreach (Match m in matches) { Console.WriteLine(m.Value); } }[/code]

Member Avatar for Momerath
0
307
Member Avatar for jay_el_em
Member Avatar for jay_el_em
0
131
Member Avatar for ajayb

[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#

Member Avatar for peter_budo
0
185
Member Avatar for daniel1977

In general header files are where you describe the class/methods, the class file is where you actually implement the class/methods.

Member Avatar for user422
0
163
Member Avatar for banh

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.

Member Avatar for banh
0
194
Member Avatar for neptunethought

[URL="http://en.wikipedia.org/wiki/ANSI_escape_code"]ANSI escape codes[/URL]. Not for the faint of heart.

Member Avatar for ddanbe
0
189
Member Avatar for CHOCHOCHO
Member Avatar for valter

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.

Member Avatar for Mitja Bonca
0
192
Member Avatar for AngelicOne

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, …

Member Avatar for Momerath
0
122
Member Avatar for ChieftanBill

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].

Member Avatar for ChieftanBill
0
143
Member Avatar for Phil++
Member Avatar for Jessurider
Member Avatar for AngelicOne

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.

Member Avatar for AngelicOne
0
122
Member Avatar for Dasharnb777

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.

Member Avatar for Dasharnb777
0
688
Member Avatar for jay_el_em

More information please :) What properties do you need? What are you trying to do? What code do you have now?

Member Avatar for Mitja Bonca
0
146
Member Avatar for JokerDoom

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 …

Member Avatar for ddanbe
0
204
Member Avatar for Zephyr-

[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 :)

Member Avatar for Momerath
0
209
Member Avatar for Phil++

if you put it in the same directory as the executable then you don't need the path.

Member Avatar for Momerath
0
87
Member Avatar for nadav64

[code]String url = "http://www.youtube.com/results?search_query=" + textbox1.Text.Trim().Replace(" ", "+") + "+" + textbox2.Text.Trim().Replace(" ", "+") + "&aq=f";[/code]

Member Avatar for Mitja Bonca
0
159
Member Avatar for carlitosway17
Member Avatar for carlitosway17
0
2K
Member Avatar for aaron385

[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.

Member Avatar for Momerath
0
320
Member Avatar for Timmo987

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.

Member Avatar for Timmo987
0
191
Member Avatar for Vardonir

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?

Member Avatar for Vardonir
0
113
Member Avatar for Phil++

Depending on your experience, it shouldn't take more than a week for a beginning program (based on the little that you have given).

Member Avatar for Mitja Bonca
0
114
Member Avatar for Diamonddrake

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 …

Member Avatar for Diamonddrake
0
120

The End.