1,857 Posted Topics

Member Avatar for ariannas

you can leverage some of the methods in the Char class for this: If Char.IsNumber(e.KeyChar) OrElse e.KeyChar = Chr(Keys.Back) OrElse e.KeyChar = "."c Then End If

Member Avatar for Ancient Dragon
0
159
Member Avatar for ariannas

decearned doesn't get set to .01 if decSubTotal is less than or equal to 500. Your assignment says the interest rate changes at 5000 not 500. The final total should be `decsubtotal + (decsubtotal * decearned)` The interest earned would be `decsubtotal * decearned`

Member Avatar for tinstaafl
0
125
Member Avatar for joester007

your error probably comes from using the length as the limit for the Substring index. Also you're trying to convert a string to a boolean. And lastly the index of substring only changes when intcounter does. so as soon as a character doesn't match the keyword you hit an infinite …

Member Avatar for joester007
0
250
Member Avatar for Abhishek_12

If your list is a simple or integrated type and you only need 1 column, you can use it as a datasource for a Listbox, which is basically the same output.

Member Avatar for tinstaafl
0
193
Member Avatar for 2mhzbrain

As long as there is a connection between the computer and the server, whether it's intranet, or internet, you can make the program connect. The main question is changing the connection string to reflect a different server address, and possibly different credentials.

Member Avatar for ikocrush
0
928
Member Avatar for Triryche

It should work the way it is. Unless your panel is only the size of the maze and the cursor is starting on a wall. Try sizing the panel to be a lot bigger than you need and moving the maze farther away from the top-left corner.

Member Avatar for Triryche
0
181
Member Avatar for andrew.mendonca.967

I think your problem is here: void reduce(void) { int numeratorValue; int denominatorValue; int getresult1; int getresult2; int gcd = getGCD(); // Get the greatest common divisor. // Get the result of the numerator. getresult1 = numeratorValue/GCD; // Get the result of the denominator. getresult2 = denominatorValue/GCD; return(getresult1, getresult2); // …

Member Avatar for nullptr
0
224
Member Avatar for TalentedIndividual

Looks to me like you'll acheive the same result with list<T> result = two; return result.merge(one); Which if I'm not mistaken is O(M+N-1), according to this [reference](http://www.cplusplus.com/reference/list/list/merge/)

Member Avatar for tinstaafl
0
535
Member Avatar for H_beginner

One problem is, in sum.h, you set up sum(), but you didn't implement it. Add this to your class definition file: sum::sum() { } On a side note, you might find it more versatile to return the answer and keep the console I/O in the calling procedure. In a large …

Member Avatar for tinstaafl
0
228
Member Avatar for Mr.M

If I'm not mistaken a '.jar' file is basically a text file. Renaming it with a '.txt' extension, will allow Visual Studio to load it as text. It's a simple matter from there to write it to disc, to run it, and delete it after you're done.

Member Avatar for Mr.M
0
180
Member Avatar for dirtydit27

Using a class that holds the from character, the to character and the number, will simplify things quite a bit for you. A vector will then have all the info you need in each item: #include <iostream> #include <string> #include <fstream> #include <vector> #include <array> #include <sstream> using namespace std; …

Member Avatar for tinstaafl
0
255
Member Avatar for mslittle1

Your second attempt came close. see if this helps. static void Main() { string numbers; Console.Write("Enter a number between 1 and 99999: "); numbers = Console.ReadLine(); DisplayDigits(numbers); } public static void DisplayDigits(string numbers) { foreach (char c in numbers) Console.WriteLine( c + " "); } If you haven't covered `foreach` …

Member Avatar for mslittle1
1
472
Member Avatar for Darkicon

You're initializing the random number generator to the same spot, every time the loop iterates. Move that to the top of your function and it should work. Also try using something like `Dim rand As New Random(Date.Now.Millisecond)`, to acheive more randomness.

Member Avatar for tinstaafl
0
575
Member Avatar for </scorpion>

Your code never compares the values in the gridview with the value in the textbox. See if something like this helps: protected void date_issued_TextChanged(object sender, EventArgs e) { DateTime newdtissued = new DateTime(); if (DateTime.TryParse(date_issued.Text, out newdtissued)) { foreach (GridViewRow row in gvw.Rows) { DateTime dtissued = Convert.ToDateTime(maDDL.getControlValue("date_issued", row)); DateTime …

Member Avatar for </scorpion>
0
283
Member Avatar for skyyadav

c++ has both a r[eplace](http://www.cplusplus.com/reference/string/string/replace/) method and a [find](http://www.cplusplus.com/reference/string/string/find/) method, for strings, which will do the job: string test2 = "I am going to school"; test2.replace(test2.find("cho"),3,"");

Member Avatar for tinstaafl
0
142
Member Avatar for ReyJEnriquez
Member Avatar for tinstaafl
0
255
Member Avatar for danielgr

You can simplify thing quite a bit by leveraging the New constructor in your class something like this: <Serializable()> _ Public Class LessonPlans Public Property Teacher As String Public Property RoomNumber As String Public Property Subject As String Public Property Students As New List(Of Student) End Class <Serializable()> _ Public …

Member Avatar for danielgr
0
266
Member Avatar for Xakzi

> Apostrophe e's ( é ) and Apostrophe's ( ´ ) Gets deleted when I decrypt. (which I have in a txt file) 'apostrophe' is declared and used but never set, changing it to 'ch' in your `if` statement should correct that. On a side note, You might be overthinking …

Member Avatar for kill-it
0
371
Member Avatar for sonunclejalil
Member Avatar for Centorpe

If the valuies taken from form1 are to be default values that the user can change as needed, one option is to overload the Show method and send the values directly to the second form when the calling form calls the Show method.

Member Avatar for tinstaafl
0
248
Member Avatar for Smalls

Here's a couple of articles with examples: [Click Here](http://msdn.microsoft.com/en-us/library/ms233672%28v=vs.110%29.aspx) [Click Here](http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-3)

Member Avatar for JOSheaIV
0
4K
Member Avatar for lxXTaCoXxl
Member Avatar for lxXTaCoXxl
0
267
Member Avatar for maurice.tracey.7

What is the routine doing or not doing, that you want fixed. Also how is your array structured, what does each row and column mean? If I read your question right, you might need to rethink your approach. Since you're only comparing 4 quarters, compare the first and last quarter …

Member Avatar for tinstaafl
0
344
Member Avatar for reed123

Here's one [place to start](https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/).

Member Avatar for tinstaafl
0
117
Member Avatar for SpottyBlue

A couple of things I noticed: Firstly, the compiler has to know how to find the functions before you call them, either have them before main in the file or declare them with prototypes. Secondly, you're passing data to your functions without telling the function how to receive the data(line …

Member Avatar for tinstaafl
0
1K
Member Avatar for Jahanzaib_2
Member Avatar for MBBS

one way is to use an array of intervals and when the user enters a number(1-5?) that's the index of the array and set the interval to that value.

Member Avatar for rishif2
0
153
Member Avatar for johnrosswrock

If you handle the MouseClick event, `e.Location` will give you the location within the pictureBox: private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { int x = e.Location.X , y = e.Location.Y; label1.Text = x.ToString(); label2.Text = y.ToString(); }

Member Avatar for ddanbe
0
128
Member Avatar for J_SON

You'll probably be better off using a class for this instead of a struct, and add a timer and a counter as properties of the class: public class Node { public string ip4 = ""; public double temp = 0.0; public double battery = 0.0; public string light = ""; …

Member Avatar for Ketsuekiame
0
1K
Member Avatar for pardeepkhatri

If they are name sequentially you can use a loop and build each name using the indexer of the loop. So if they are named PictureBox1,PictureBox2,etc., the code could look something like this: For I = 1 to 4 Me.Controls("PictureBox"+I.ToString).Visible = True Next The controls collection allows indexing by name. …

Member Avatar for deceptikon
0
276
Member Avatar for Xakzi

First thing needed is how are coding the app? Are you using VC++ with CLR? or some other library? Also you should show what code you've got. Include what effort you've made to research this question.

Member Avatar for Xakzi
0
4K
Member Avatar for iFrolox

Swapping listviewitems is problematic at best. I think the problems stems from the fact that Insert creates a new item. The most viable solution is probably to swap the data of the items. Here's one way that can be done, this code is somewhat optimized and modified for groups, from …

Member Avatar for iFrolox
0
2K
Member Avatar for Sci3nc3F1cti0n

You can also shorten your code considerably using the pow function and leveraging the implicit cast between char and int. something like this: string ToBinary(int input) { //Fill the array with 0's and only change the needed elements to a 1 char output[9] = "00000000"; for(int i= 7; i >= …

Member Avatar for tinstaafl
0
844
Member Avatar for bullet_1

A sample of the beginning data and a sample of the desired ending data would be very helpful

Member Avatar for tinstaafl
0
159
Member Avatar for SteveyD

use [Application Settings](http://msdn.microsoft.com/en-us/library/vstudio/a65txexh%28v=vs.100%29.aspx/html)

Member Avatar for timmyjoshua
0
123
Member Avatar for maurice.tracey.7

The only thing I see is that `loss = loss++;` is redundant. `loss++;` does the same thing. Other than that if `company` is an array of int, double, etc. and any value less than 0 indicates a loss, 2 loops will iterate through the array and get the total you're …

Member Avatar for maurice.tracey.7
0
166
Member Avatar for Jahliah

If you don't need the data kept in memory after you save it you can write it directly from the first loop using (StreamWriter write = new StreamWriter(filePath, true)) { string[] line = strInput.Split('~'); foreach (string part in line) { string[] strField = part.Split(','); write.WriteLine(strField[0] + "," + strField[5] + …

Member Avatar for sai ram
0
166
Member Avatar for bullet_1

Try this: `temp = line.Replace("Figure 1", @"<a href=""#fig1"">Figure 1</a>")` on a side note, when you have a problem like this, it helps when you explain what you've tried and what it does wrong.

Member Avatar for gusano79
0
176
Member Avatar for ricardo.scheufele

I think the problem is that data binding won't show until the control is visible. You might have to resort to a function to apply the properties to the textboxes

Member Avatar for ricardo.scheufele
0
720
Member Avatar for anJelo.towT

First off that code looks like VB6 not VB.net. Try setting the value of the subitems instead of the whole object.

Member Avatar for tinstaafl
0
139
Member Avatar for Ahmed.C
Member Avatar for DM Galaxy

when the mouse is dragged from the corner read the movement along both the x and y axis and adjust the resize on both x and y axis. Something like this: Dim XOffset, YOffset as Integer XOffset = MousePosition.X - Me.Location.X YOffset = MousePosition.Y - Me.Location.Y Me.Size = New Size(Me.Location.X …

Member Avatar for tinstaafl
0
3K
Member Avatar for tiff2013

It might need a bit of a re-write, but one way is to put your input into a stringstream and use the '>>' operator to convert to double or whatever type you need, and do your calulations with that.

Member Avatar for tinstaafl
0
130
Member Avatar for DM Galaxy

Here's one [place to start](http://www.codeproject.com/Articles/25625/Notepad-NET-Creating-a-clone-of-notepad-in-Visual)

Member Avatar for DM Galaxy
-1
367
Member Avatar for Falcon143

Not sure about optimal but here's a way using included functions, rather than chained conditionals: #include <iostream> #include <cmath> using namespace std; int Clip(int Val) { return fmin(fmax(Val,0.0),255.0); } int main() { int test; test = 100; cout << Clip(test); return 0; }

Member Avatar for Banfa
0
2K
Member Avatar for TechSupportGeek

You could try handling the Validated event. You have the option to cancel the validation so that the user's focus stays on the textbox until the value is valid. Using the Integer.TryParse then checking the value, is an easy way to validate the text. Alternatively using a NumericUpDown control will …

Member Avatar for TechSupportGeek
0
179
Member Avatar for Dili1234
Member Avatar for Koelald
0
277
Member Avatar for ricardo.scheufele
Member Avatar for tinstaafl
0
865
Member Avatar for tinstaafl

I've noticed that comments in VB code snippets are ended in the middle of a line if an apostrophe is present(i.e. using a contraction), then continue from the next one over several lines until it reaches another. I'm wondering if that can't be changed to keep it as a comment …

Member Avatar for tinstaafl
0
244
Member Avatar for Ahmed.C

When I run your Sdriveer sub routine it works properly and reports the drives on the computer it's running from. I suspect the computer your testing it with has an E drive and that's why you're seeing an entry for it.

Member Avatar for tinstaafl
0
205

The End.