1,857 Posted Topics
![]() | Re: When you call form2 create a new instance of it, then when it closes you can still access the values in any of the properties and/or controls. A good way to tell when the form closes is by using the ShowDialog method which returns a dialog result when the form … |
Re: It looks to me if the dates are stored as strings you'll have to convert them to a date type to be able to compare the months like that. | |
Re: 2 things I noticed, . If returnprice is returning an int then price should be an int not a string. Class B has no public: modifier, therefore nothing is visible outide the class. | |
Re: Instead of ReadAllBytes try the [BinaryReader.Read Method](http://msdn.microsoft.com/en-us/library/vstudio/ms143295%28v=vs.100%29.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1) which has an overload to fill a buffer on each read. | |
Re: When you're using .net for a windows form project both the .net library and the C++ standard library are available. For many people, using the .net library is more intuitive. Also if at some point you branch out and start using other .net languages being used to the .net library … | |
Re: @TheRealSai you should start your own question. Remember to include the code you've done and details about where exactly the code is failing. | |
Re: For your purposes you're probably better off returning the value you want rather than passing an address to the function. Your code becomes much more readable and easier to understand. Here's a few simple improvements to your code: #include <iostream> //cout and cin #include <string> //for string use #include <conio.h> … | |
Re: One idea is to start by telling us what the program is and isn't doing right. Especially since aside from needing the output formatted better, this seems to do what you want. | |
Re: We need to see a sample of the data. The code is trying to read half the file into one array then the other half into a different array, sequentially. If the data isn't set up that way then your code won't work right. In order to fix it we'll … | |
Re: If you actually read the rules before you posted this, you would see how inappropriate the post is. This site basically helps those that helps themselves. Show some effort with a specific problem and people will be more than happy to help. But we won't do your homework for you. … | |
Re: Consdider the following function that will take any string such as you described and offsets each character by a value of 1 , loops back to 'a' and keeps any capitalization: string EncryptString() { string retval; for(int i = 0; i < theString.length(); i++) { //temporary variable to hold each … | |
Re: Whichever sort algorithm you use you have 2 main choices, either change the gpa array with the same index parameters you're changing the ID array with. Or, use a custom class and put the data in an array or vector of that class. This way the data is strongly coupled … | |
Re: A richtextbox is designed to allow different font, foreground and background colors for every letter. Here's the [documentation](http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox%28v=vs.110%29.aspx) for it | |
Re: Saying you get a bunch of errors doesn't help anyone give an answer. You have to itemize the error messages you're getting, especially the line it's pointing to. One problem you have is you're using `NUM_STUDENTS` but it's not defined any where in your code. Another problem, you're trying to … | |
Re: According to this quote from an [online reference](http://www.cplusplus.com/doc/tutorial/control/) >Notice that switch can only be used to compare an expression against constants. Therefore we cannot put variables as labels (for example case n: where n is a variable) or ranges (case (1..3):) because they are not valid C++ constants. > If … | |
Re: In the answers in this [post](http://www.daniweb.com/software-development/vbnet/threads/461971/calendar-application), there are links to examples. | |
Re: Hard to tell for sure, but it seems to me that you want to randomize the background color. Simply make an array of the color choices and get a random index to choose the color. If you need help with using the rand() function here's a [tutorial](http://www.daniweb.com/software-development/cpp/threads/1769/c-random-numbers) on it. | |
Re: To me one of your first steps would be to design a class(es) to hold the meaurements and the methods for making your calculations. One word of advice the math looks like it will get fairly complicated, so making the property names verbose and meaningful will help you keep the … | |
Re: If your original code was referencing .net1.1 then you try and load it as .net2.0 these sorts of thing can happen. You should start a new project then copy the code over and fix it from there. | |
| |
Re: It sounds like you're making it more complicated than it needs to be. A ListView was designed for this type of data. Set the View property to details and set the columns up. Now each row belongs to separate item. If you must insist on using a rtb the Lines … | |
Re: The first thing I'd suggest is using a MaskedTextBox. You can set the format to be only integers. Then handle the Validated event to check for divisibility by ten. The mod operator returns the remainder from a division. So if the quotient is 0 the dividend is exactly divisible by … | |
Re: One way is to create a class(`Public Class User`), with username, password, user type and time to expire as properties. My.Settings will accept objects so a List(Of User) can be stored and read quite easily. How this is implemented can be refined when you show the code for the project … | |
Re: In the properties of the MdiParent look for IsMdiContainer and set that to true. | |
Re: try googling 'c++ library Base85' That showed me a c++ source, a vb source and a c source and a fairly simple tutorial as well, all in the first page. | |
Re: Here's an [article](http://v2.cplusplus.com/faq/sequences/strings/split/) that discusses several options for splitting string in c++. | |
Re: A curious thing. It formats properly when the section is made longer, i.e. when a tag is added. Couldn't the code detect long names and just make the section longer?  I see this in firefox win7 | |
Re: The error code you're getting indicates that one of the arguments isn't valid. Here's the [msdn article](http://msdn.microsoft.com/en-us/library/windows/desktop/ms221283%28v=vs.85%29.aspx) that outlines all the pariculars. | |
Re: One option is to keep the button's enabled property to false until both textboxes have data. One way to keep track of that, without extra global variables, is to use the Tag property for each textbox. You could use a common validating event handler for the 2 textboxes to check … | |
Re: Except for lines 69-74 you probably want those before the loop. | |
Re: One thing that might help is write the bytes to a file and use a Hex Editor to see what the individual bytes are. Decoding from binary is in a class all its own, since you have no idea how many bits make up a byte and how many bytes … | |
Re: The for loop has these part, for(initialize counter;set condition that while true the loop will run;set increment). In your example the counter(n) is already initialized so that part is skipped. The loop will run as long as the counter(n) is not 0. In each iteration of the loop the counter(n) … | |
Re: A couple of things I noticed. Several of your functions are supposed to return an Integer and your returning a String. This is a sloppy habit to get into and can create huge problems in a large project. One way to guard against this is to set Option Strict to … | |
Re: What is your code doing or not doing that you want changed? What is a sample of the data in the text file? | |
Re: Not sure what your question is. The `genera_archivo()` sub routine is already reading the elements of your structure. To read a file instead of writing to a file, you could use `ifstream` and just change the operator to `>>`. On a side note, you're incrementing `i` twice every time you … | |
Re: something like this should work: Dim NewLabel as Label NewLabel.Text = Date.Now.ToString For i=1 to DataSet.Tables("myTable").Rows.Count Dim Row as Datarow = DataSet.Tables("myTable").Select("ID = " & i) Dim Time as Date = Row.Item("Time") If(Time < Date.Parse(NewLabel.Text)) Then NewLabel.text = Time.ToString() End If Next FlowLayoutPanel.Controls.Add(NewLabel) | |
Re: If you declare it at class level(outside any subs or functions), then any routine can access it. | |
Re: Something like this might help: For Each file As String In Directory.GetFiles("C:\", "*.mp3") File.Copy(file, "MyNewDirectory\" & Path.GetFileName(file)) Next If you need to do it with only the names in the listbox For Each name As String In ListBox1.Items File.Copy("C:\" & name, "MyNewDirectory\" & name) Next If you want the original … | |
Re: If this is for a custom class, VB is probably suggesting that you also have a default New constructor: Public Sub New() intProdNumber = 0 End Sub It's ok to have both. Also remember your constructors should initialize every member of your class | |
Re: Your first step will probably be to add a Login form to your project. The template is included in VB.net. Just use the Add-New Item option. At this point you have the form elements needed to process the login. One option to store the data for each user, is to … | |
Re: This [post](http://www.daniweb.com/software-development/cpp/threads/402920/a-litttle-problem-with-file-handling) should help | |
Re: It's hard to tell exactly what you mean without functioning code. The snippet you gave, isn't complete and it's not formatted at all. | |
Re: If each item is a set of 2 numbers then your array is really a 2X4X2 | |
Re: One option would be to use php. Here's an [open source project](http://sourceforge.net/projects/wass/?source=navbar) that seems to do what you want. Here's an [example in ASP.net](http://www.codeproject.com/Articles/31766/DayPilot-Scheduler-Control-for-ASP-NET), which might help | |
Re: I suspect the code is shown using hexadecimal(base16), which is composed of numbers and the letters A-F. If this is correct, the code, will most likely, have to be broken down into 2 character strings and converted to 8-bit bytes(base10), assuming ASCII encoding and not Unicode. | |
Re: Since you're starting with a standard button and modifying it, you should have access to the MouseEnter event. Put your code to change the button in there. Setting the [TransparencyMask of the Bitmap](http://msdn.microsoft.com/en-us/library/vstudio/system.windows.forms.controlpaint.createhbitmaptransparencymask%28v=vs.100%29.aspx) Should help in what you want. One alternative to the button is the label. By changing the … | |
Re: What he most likely means is that each button will pass both operands and a code for the operation required to a sub routine named results that will carry out the required operation and output the result. If you look at your code you'll see how there are several blocks … | |
Re: Also you have a constant `NUM_CITIES` set to 5 | |
Re: it seems to me that to use the (size_t,char) string constructor you should probably be constructing a new string. Something like this should work: Screen::Screen(pos ht, pos wd) { contents = string(ht*wd, ' '); height = ht; width = wd; cursor = 0; } Screen::Screen(char c, pos ht, pos wd) … | |
Re: Since this is a different question you should really start your own. A word of advice, use real code. Pseudocode doesn't tell anyone about what kind of structure you're using or how any classes are set up, etc.. |
The End.