1,857 Posted Topics
Re: The code was probably designed for a different .net framework. If it's lesser change the framework type in the properties. If it's greater you may need to upgrade your version of VS. | |
Re: You should probably read this [article](http://www.cplusplus.com/articles/2LywvCM9/) and gain a better understanding of what inline functions are and how to call them. | |
Re: First piece of advice turn on `Option Eplicit` and`Option Strict`. You're calling the sub routine a Function but it has no return type nor is it returning anything. To access a field or property inside a class it must be declared as Public. Use that instead of Dim. Now the … | |
Re: Do you want it on a row above the other one or sitting right on top of it basically obscurring? | |
Re: Hard to say why it's not working since you don't show the code you're using. However, this `richTextBox1.SaveFile("myrtffile.rtf");` should work. Loading the file could look like this: `richTextBox1.Rtf = System.IO.File.ReadAllText("myrtffile.rtf");` | |
Re: One of your main problems start here: `main()`. There is no return type. Since your returning 0 I would assume you want `int main()`, since that is the standard declaration. Also in `getline` you've declared `c` as int but you use it as a char. While this works it is … | |
Re: This code probably is where the problem is. However without the code showing the class(es) represented in your code, it's pretty hard to decipher what exactly your code is doing. | |
Re: So which code is the one you're using? this one or the one [here](http://www.daniweb.com/software-development/csharp/threads/479934/csv-file-replace-on-specific-column)? | |
Re: It's hard to tell exactly what you mean. The form has a BackgroundImage property that you can set to show an image in the background. You also have available a PictureBox control which you can use to show images. | |
Re: It appears to me that `sender` is of type `Button` and you're trying to cast it as a `DataGrid`. When the cast fails, `dgResults` will be nothing and any calls to it will result in the exception. | |
Re: The main problem appears to be int trying to change the value of a constant. If you remove the `const` declaration for the `>>` operator in the declaration and the method, it should work: #include <iostream> template <unsigned, unsigned> class Screen; template <unsigned H, unsigned W> std::ostream& operator<<(std::ostream&, const Screen<H, … | |
Re: One thing I noticed: `ioHandler::getAccount` doesn't validate the user input. Also since `acc_list` is an array of type `Account` you don't need to declare an element to assign a value to it: Instead of: Account acc_list[count](a); Try: acc_list[count] = a; In: void AccountList::insertAccount(Account a) { if (count > MAX) { … | |
Re: It looks to me that you have 2 main options. 1 - In the load event handler loop through the Textboxes and add your code as a validating event handler, or whichever one seems appropriate. 2 - Change all the textboxes to a custom control that inherits TextBox and validates … | |
Re: Just a quick perusal shows 2 things: if (double.TryParse(Textboxother.Text, out n)) MessageBox.Show("Please Enter a Valid Length. \n Amount given is: " + Textboxother.Text); if (float.TryParse(InterestRateCB.SelectedItem.ToString(), out r)) MessageBox.Show("Enter a Valid Interest Rate"); Both of these should be using the '!' operator. | |
Re: A couple of things: Your string is returning a comma-delimited line of values. You may need to split it by ","c and insert the appropriate fields into your table. Using a dictionary will simplify your code tremendously: ReadOnly DecryptChars As Dictionary(Of Char, Char) = New Dictionary(Of Char, Char) From { … | |
Re: Here's a pretty good [explanation](http://www.cplusplus.com/reference/queue/priority_queue/?kw=priority_queue) of the priority_queue. Basicaly it boils down to the fact that indexing([]) isn't implemented but random acces iterators are. | |
Re: This [example](http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.print%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2) in the MSDN documention shows how to set the margins when printing a page. | |
Re: Try adding another ')' on the end of the `while` statement. | |
Re: Your code doesn't seem to match your description. Does the key represent a user or a user group? This is confusing because you've commented the int_vect as a vector of users. Does this mean that you want to add, remove, or move users from one vector or another? Or do … | |
Re: A look at your code would help. | |
Re: Umm, errors mean you didn't do something right. Most of your errors appear to be syntax related. for instance you have: bool DynStack<T>:isEmpty() Instead of bool DynStack<T>::isEmpty() As you fix each error do a new build, since the way compilers read source code one syntax error can multiply and throw … | |
Re: From my understanding the biggest deciding point is portability. C++ is very portable and be easily ported to different operating systems. C# is designed for Windows using the .net library. You can acheive some portability with it by using a third library, like Mono. Much of the syntax is very … | |
Re: First thing research how to institute a menu interface for you app. Then start researching code examples for the different functions. What you're asking for is easy to research and find. Once you have some code you're trying to get working but can't start a new question. | |
Re: You could use a DataTable as the datasource for the datagridview. It has methods for loading and saving .xml files. | |
Re: Some things I'd suggest: Use a menu for user inputs at the start of the program and to set up the game. Use a letter/number combination for the coordinates of the grid. Use a function to display the grid using the grid size and the array as parameters If you … | |
Re: Here's one way using LINQ: Dim searchstr = "9001" doc.Descendants("OfferProgressTotals") _ .Where(Function(x) x.HasAttributes) _ .Where(Function(x) x.Attribute("OfferID").Value = searchstr) _ .First(Function(x) Console.WriteLine("Offer ID : {0}" & vbNewLine _ & "Eligible Date : {1}" & vbNewLine, _ x.Attribute("OfferID").Value, _ x.Element("EligibleDate").Value) Return True End Function) _ .Descendants("OfferProgressTotal") _ .ToList _ .ForEach(Sub(x) Console.WriteLine("ID : … | |
Re: One problem you could be having, is you're calling your sub routines without initializing `firstRecord`. As a result it contains random data, which could be causing your routine to crash. Try something simple like `int firstRecord = 0;`. If you still have a problem submit some test data which will … | |
Re: If I'm not mistaken, buttons don't have that functionality. One way to work around this, is to use a label which also has a click event and allows transparency. If necessary you can flip between border styles to simulate a button. | |
Re: For what you're doing string and vector would be much easier to use than creating arrays out of raw memory: #include <iostream> #include <fstream> #include <string> #include <vector> using std::string; using std::vector; using std::cin; using std::cout; using std::ifstream; int main() { const int size = 100; ifstream data_file ( "Text.txt" … | |
Re: The TableLayoutPanel is a container control its designed to hold other controls not display text. Use textboxes, richtextboxes in the cells to handle the key presses. | |
Re: Or having somewthing to say that people are willing to read and selling advertising and/or using pay-per-click | |
Re: The one thing that jumps out at me, is that your class is called `Service` but the only place you try to call `GetDateRange` is with an object declared as type `ServiceClient`. If you do indeed have a class called `ServiceClient` you'll be seeing the output from that class not … | |
Re: Try adding `\n` to your string. If that doesn't work try `\r\n`. >Also How would I make a If statement where if the button is clicked then it prints "Hola" into the richtextbox? First step would be to create an event handler for the button click event. Then put the … | |
Re: Have you tried assigning `grouping.Sum(s => s.Item1)` to a variable, something like this?: public static tuplePolynomial operator +(tuplePolynomial tp1, tuplePolynomial tp2) { tuplePolynomial Result = new tuplePolynomial(); Result.Terms = ( from t in tp1.Terms.Concat(tp2.Terms) group t by t.Item2 into grouping let groupingsum = grouping.Sum(s => s.Item1) where groupingsum != 0.0 … | |
Re: One relatively simple way would be with LINQ: ListBox1.Items.AddRange(Enumerable.Range(2, 699).Select(Function(x) (x / 100).ToString).ToArray) | |
Re: Your problem is here: cout << "Enter player # " << (i + 1) << "'s full name: "; cout << endl; cin.ignore(); cout << endl; getline(cin, soccer[i].name); cout << endl; The `cin.ignore();` is ignoring the first character typed. Also all those `endl`'s aren't necessary. Try this instead: cout << … | |
Re: What error codes are you getting? Which line(s) are they pointing to? | |
Re: Your first step will most likely be to create a class to represent each student. ![]() | |
Re: The value depends on the object. Intrinsic types have a default built into the type. Custom types can be set within the code. | |
Re: Since the forms derive from a form that calls the method in the load event each derived form will also call the method, but because that method is overriden the specific one to the derived form is used. If you want to override that behaviour you should be able to … | |
Re: The get and set allow you to use code to adapt the input to fit the property. For instance if the values allowed for the property are restrictive you can validate the input in the set before passing the value to the property. Another use of these is to obscure … | |
Re: How do the values in your examples correspond to the variables in your code or the columns in your datagridview? What does SYD do? | |
Re: Using a couple of arrays as lookup tables will help shorten your code tremendously: const string digits = "IVXLCDM"; const int number[] = {1,5,10,50,100,500,1000}; int amount[] = {0,0,0,0,0,0,0}; string ToRoman(int input) { if(!input < 4000) return "Invalid input"; for(int i = 6;i > -1; i-=2) { amount[i] = (int)(input/pow(10,(i/2))); input … | |
Re: your code is mostly correct. You have the limit on the first for loop as less than or equals(<=) to passengers.Length. This means you must oversell 1 seat in order to exit. This should be just less than(<). Also the routine to print the names should be outside the main … | |
Re: It would probably help to break your problem down into parts. First decide what language you will be using. Since you want a GUI, using a .net language would probably be the easiest. If you have a background in c++ the c++/clr option is viable. You could also easily go … | |
Re: A Listview can't accept a datasource. You'll have to put the data into a datatable and parse each row and add the data to the listview. You might find a DataGridView, which will accept a datasource, much easier to work with in this case. Then it's a matter of creating … | |
Re: Basically on each iteration it chooses a random index and increments the value stored in the array at that index by 1. The end result is, you should end up with each item, from index 1 to 6, in the array containing a count of how many times that index … | |
Re: Instead of sending your output to the screen as soon as you get the discount value, it's much easier to read if you save the discount and have only 1 `cout` statement. Also checking for the maximum value first simplifies the if-else structure. Something like this: #include <iostream> using namespace … |
The End.